@teamix/typography
Version:
221 lines (183 loc) • 3.63 kB
text/less
@import './themes.less';
@import './mixins.less';
// =============== Basic ===============
.@{typography-prefix-cls} {
overflow-wrap: break-word;
// copy和edit默认隐藏,hover显示
&-copy,
&-edit {
visibility: hidden;
}
&:hover {
.@{typography-prefix-cls}-copy,
.@{typography-prefix-cls}-edit {
visibility: visible;
}
}
&&-secondary {
color: @text-color-secondary;
}
&&-success {
color: @success-color;
}
&&-warning {
color: @warning-color;
}
&&-danger {
color: @error-color;
a&:active,
a&:focus,
a&:hover {
color: @error-color-hover;
cursor: pointer;
}
}
&&-disabled {
color: @disabled-color;
cursor: not-allowed;
user-select: none;
}
// Tag
div&,
p {
.typography-paragraph();
}
a&-ellipsis,
span&-ellipsis {
display: inline-block;
}
code {
margin: 0 0.2em;
padding: 0.2em 0.4em 0.1em;
font-size: 85%;
background: rgba(150, 150, 150, 0.1);
border: 1px solid rgba(100, 100, 100, 0.2);
border-radius: 3px;
}
kbd {
margin: 0 0.2em;
padding: 0.15em 0.4em 0.1em;
font-size: 90%;
background: rgba(150, 150, 150, 0.06);
border: 1px solid rgba(100, 100, 100, 0.2);
border-bottom-width: 2px;
border-radius: 3px;
}
mark {
padding: 0;
background-color: @gold-3;
}
u,
ins {
text-decoration: underline;
text-decoration-skip-ink: auto;
}
s,
del {
text-decoration: line-through;
}
strong {
font-weight: @font-weight-3;
}
// Operation
&-expand,
&-edit,
&-copy {
.operation-unit();
margin-left: 4px;
}
&-copy-success {
&,
&:hover,
&:focus {
color: @success-color;
}
}
// Text input area
&-edit-content {
position: relative;
div& {
left: -@input-padding-horizontal - 1px;
margin-top: calc(@input-multiple-font-size / 2 - 7px - 2px);
// stylelint-disable-next-line function-calc-no-invalid
margin-bottom: calc(1em - 2px);
}
&-confirm {
position: absolute;
right: 5px;
bottom: 5px;
color: @text-color-secondary;
pointer-events: none;
}
// Fix Editable Textarea flash in Firefox
textarea {
-moz-transition: none;
}
}
// list
ul,
ol {
margin: 0 0 1em 0;
padding: 0;
li {
margin: 0 0 0 20px;
padding: 0 0 0 4px;
}
}
ul {
list-style-type: circle;
ul {
list-style-type: disc;
}
}
ol {
list-style-type: decimal;
}
// pre & block
pre,
blockquote {
margin: 1em 0;
}
pre {
padding: 0.4em 0.6em;
white-space: pre-wrap;
word-wrap: break-word;
background: rgba(150, 150, 150, 0.1);
border: 1px solid rgba(100, 100, 100, 0.2);
border-radius: 3px;
// Compatible for marked
code {
display: inline;
margin: 0;
padding: 0;
font-size: inherit;
font-family: inherit;
background: transparent;
border: 0;
}
}
blockquote {
padding: 0 0 0 0.6em;
border-left: 4px solid rgba(100, 100, 100, 0.2);
opacity: 0.85;
}
// ============ Ellipsis ============
&-ellipsis-single-line {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
// https://blog.csdn.net/iefreer/article/details/50421025
a&,
span& {
vertical-align: bottom;
}
}
&-ellipsis-multiple-line {
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 3;
/*! autoprefixer: ignore next */
-webkit-box-orient: vertical;
}
}
@import './rtl';