Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add text-decoration-style utilities #5970

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 16 additions & 6 deletions src/corePlugins.js
@@ -1,16 +1,16 @@
import fs from 'fs'
import * as path from 'path'
import postcss from 'postcss'
import createUtilityPlugin from './util/createUtilityPlugin'
import { version as tailwindVersion } from '../package.json'
import buildMediaQuery from './util/buildMediaQuery'
import parseAnimationValue from './util/parseAnimationValue'
import createUtilityPlugin from './util/createUtilityPlugin'
import flattenColorPalette from './util/flattenColorPalette'
import withAlphaVariable, { withAlphaValue } from './util/withAlphaVariable'
import toColorValue from './util/toColorValue'
import isPlainObject from './util/isPlainObject'
import transformThemeValue from './util/transformThemeValue'
import { version as tailwindVersion } from '../package.json'
import log from './util/log'
import parseAnimationValue from './util/parseAnimationValue'
import toColorValue from './util/toColorValue'
import transformThemeValue from './util/transformThemeValue'
import withAlphaVariable, { withAlphaValue } from './util/withAlphaVariable'

export let variantPlugins = {
pseudoElementVariants: ({ addVariant }) => {
Expand Down Expand Up @@ -1645,6 +1645,16 @@ export let corePlugins = {
)
},

textDecorationStyle: ({ addUtilities }) => {
addUtilities({
'.decoration-solid': { 'text-decoration-style': 'solid' },
'.decoration-double': { 'text-decoration-style': 'double' },
'.decoration-dotted': { 'text-decoration-style': 'dotted' },
'.decoration-dashed': { 'text-decoration-style': 'dashed' },
'.decoration-wavy': { 'text-decoration-style': 'wavy' },
})
},

fontSmoothing: ({ addUtilities }) => {
addUtilities({
'.antialiased': {
Expand Down
3 changes: 3 additions & 0 deletions tests/basic-usage.test.css
Expand Up @@ -774,6 +774,9 @@
.decoration-red-600 {
text-decoration-color: #dc2626;
}
.decoration-solid {
text-decoration-style: solid;
}
.antialiased {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down
1 change: 1 addition & 0 deletions tests/basic-usage.test.html
Expand Up @@ -162,6 +162,7 @@
<div class="text-opacity-10"></div>
<div class="underline"></div>
<div class="decoration-red-600"></div>
<div class="decoration-solid"></div>
<div class="overflow-ellipsis truncate"></div>
<div class="uppercase"></div>
<div class="transform transform-gpu transform-none"></div>
Expand Down