implement underline text as error (#1015)

main
Michael Fix 5 years ago committed by GitHub
parent fcd5cee30b
commit b4db340511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,6 +34,15 @@ function searchLanguage(l) {
}
function noop() {}
function getUnderline(underline) {
switch (underline) {
case 1:
return 'underline'
case 2:
return `${COLORS.RED} wavy underline; text-decoration-skip-ink: none`
}
return 'initial'
}
class Carbon extends React.PureComponent {
static defaultProps = {
@ -115,8 +124,7 @@ class Carbon extends React.PureComponent {
const css = [
changes.bold != null && `font-weight: ${changes.bold ? 'bold' : 'initial'}`,
changes.italics != null && `font-style: ${changes.italics ? 'italic' : 'initial'}`,
changes.underline != null &&
`text-decoration: ${changes.underline ? 'underline' : 'initial'}`,
changes.underline != null && `text-decoration: ${getUnderline(changes.underline)}`,
changes.color != null && `color: ${changes.color} !important`,
]
.filter(Boolean)

@ -37,7 +37,7 @@ function reducer(state, action) {
case 'UNDERLINE': {
return {
...state,
underline: !state.underline,
underline: Number(state.underline + 1) % 3,
}
}
case 'COLOR': {

Loading…
Cancel
Save