stiff-rock-react-md-editor
Version:
A markdown editor with preview, implemented with React.js and TypeScript.
142 lines (123 loc) • 3.26 kB
text/less
@md-editor: ~ "w-md-editor";
.@{md-editor} {
&-area {
overflow: auto;
border-radius: 5px;
}
&-text {
min-height: 100%;
position: relative;
text-align: left;
white-space: pre-wrap;
word-break: keep-all;
overflow-wrap: break-word;
box-sizing: border-box;
padding: 10px;
margin: 0;
font-size: 14px ;
line-height: 18px ;
font-variant-ligatures: common-ligatures;
&-pre,
&-input,
&>&-pre {
margin: 0;
border: 0;
background: none;
box-sizing: inherit;
display: inherit;
font-family: inherit;
font-family: var(--md-editor-font-family) ;
font-size: inherit;
font-style: inherit;
font-variant-ligatures: inherit;
font-weight: inherit;
letter-spacing: inherit;
line-height: inherit;
tab-size: inherit;
text-indent: inherit;
text-rendering: inherit;
text-transform: inherit;
white-space: inherit;
overflow-wrap: inherit;
word-break: inherit;
word-break: normal;
padding: 0;
}
&-pre {
position: relative;
margin: 0px ;
pointer-events: none;
background-color: transparent ;
>code {
padding: 0 ;
font-family: var(--md-editor-font-family) ;
font-size: 14px ;
line-height: 18px ;
}
}
&-input {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
resize: none;
color: inherit;
overflow: hidden;
outline: 0;
padding: inherit;
-webkit-font-smoothing: antialiased;
-webkit-text-fill-color: transparent;
&:empty {
-webkit-text-fill-color: inherit ;
}
}
&-pre,
&-input {
word-wrap: pre;
word-break: break-word;
white-space: pre-wrap;
}
}
}
/* Modern approach for high contrast modes */
@media (forced-colors: active) {
.@{md-editor}-text-input {
/* Handle high contrast mode specific styling */
forced-color-adjust: none;
selection {
background-color: Highlight ;
color: HighlightText ;
}
}
}
.@{md-editor}-text-pre {
.punctuation {
color: var(--color-prettylights-syntax-comment, #8b949e) ;
}
.token.url,
.token.content {
color: var(--color-prettylights-syntax-constant, #0550ae) ;
}
.token.title.important {
color: var(--color-prettylights-syntax-markup-bold, #24292f);
}
.token.code-block .function {
color: var(--color-prettylights-syntax-entity, #8250df);
}
.token.bold {
font-weight: unset ;
}
.token.title {
line-height: unset ;
font-size: unset ;
font-weight: unset ;
}
.token.code.keyword {
color: var(--color-prettylights-syntax-constant, #0550ae) ;
}
.token.strike,
.token.strike .content {
color: var(--color-prettylights-syntax-markup-deleted-text, #82071e) ;
}
}