zfb
GitHub repository

Type to search...

to open search from anywhere

Text style

Set text decoration, letter case, font style, numeric shaping, and smoothing.

Change the line decoration, letter case, or font treatment without changing the words in the source. These utilities affect different CSS properties, so combine them only when each behavior is intentional.

Quick reference

Example classExpected declarations
underlinetext-decoration-line: underline;
overlinetext-decoration-line: overline;
line-throughtext-decoration-line: line-through;
no-underlinetext-decoration-line: none;
uppercasetext-transform: uppercase;
lowercasetext-transform: lowercase;
capitalizetext-transform: capitalize;
normal-casetext-transform: none;
italicfont-style: italic;
not-italicfont-style: normal;
tabular-numsfont-variant-numeric: tabular-nums;
antialiased-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
Example setup

The shared preview base explicitly selects spec 1, reset none, strict mode, spacingUnit 0.25rem, and no breakpoints. The examples apply each class directly to the text whose behavior it demonstrates. The scaffold adds only layout, borders, spacing, and inherited link color. Case transforms change Latin letters but do not case-convert Japanese kana or kanji.

Examples in use

Choose a decoration line

The rows compare underline, overline, and line-through. The link starts with the browser underline so no-underline shows its reset behavior.

Choose a decoration line
HTML
<div class="wind-demo-style-stack">
  <p><span class="underline">Underline / 下線</span></p>
  <p><span class="overline">Overline / 上線</span></p>
  <p><span class="line-through">Line through / 取り消し線</span></p>
  <p><a href="#normal-text" class="no-underline">No underline / 下線なし</a></p>
</div>
CSS
@layer zw-reset, zw-tokens, zfb-hi, base, components;
@layer zw-tokens {
  :root {
    --zw-spacing-unit: .25rem;
  }
}
.wind-demo-style-stack {
  color: #223247;
  border: 1px solid #b7c5d4;
  padding: .6rem 1rem;
}

.wind-demo-style-stack p {
  margin: 0;
  padding: .45rem 0;
  border-bottom: 1px solid #d8e0e8;
}

.wind-demo-style-stack p:last-child {
  border-bottom: 0;
}

.wind-demo-style-stack a {
  color: inherit;
}
.line-through {
  text-decoration-line: line-through;
}
.no-underline {
  text-decoration-line: none;
}
.overline {
  text-decoration-line: overline;
}
.underline {
  text-decoration-line: underline;
}
Configuration for this example
{
  "wind": {
    "spec": 1,
    "reset": "none",
    "strict": true,
    "tokens": {
      "spacingUnit": "0.25rem"
    },
    "breakpoints": {},
    "defaultTransitionTimingFunction": "ease",
    "authoredClasses": {
      "wind-demo-style-stack": true
    },
    "safelist": {
      "docs-preview": [
        "underline",
        "overline",
        "line-through",
        "no-underline"
      ]
    }
  }
}
Authored demonstration CSS
.wind-demo-style-stack { color: #223247; border: 1px solid #b7c5d4; padding: 0.6rem 1rem; }
.wind-demo-style-stack p { margin: 0; padding: 0.45rem 0; border-bottom: 1px solid #d8e0e8; }
.wind-demo-style-stack p:last-child { border-bottom: 0; }
.wind-demo-style-stack a { color: inherit; }

Transform Latin letter case

The same bilingual phrase demonstrates the four case controls; the Japanese characters stay unchanged.

Transform Latin letter case
HTML
<div class="wind-demo-style-stack">
  <p><span class="uppercase">Wind notes / 見出しの整え方</span></p>
  <p><span class="lowercase">Wind notes / 見出しの整え方</span></p>
  <p><span class="capitalize">wind notes / 見出しの整え方</span></p>
  <p><span class="normal-case">WIND NOTES / 見出しの整え方</span></p>
</div>
CSS
@layer zw-reset, zw-tokens, zfb-hi, base, components;
@layer zw-tokens {
  :root {
    --zw-spacing-unit: .25rem;
  }
}
.wind-demo-style-stack {
  color: #223247;
  border: 1px solid #b7c5d4;
  padding: .6rem 1rem;
}

.wind-demo-style-stack p {
  margin: 0;
  padding: .45rem 0;
  border-bottom: 1px solid #d8e0e8;
}

.wind-demo-style-stack p:last-child {
  border-bottom: 0;
}
.capitalize {
  text-transform: capitalize;
}
.lowercase {
  text-transform: lowercase;
}
.normal-case {
  text-transform: none;
}
.uppercase {
  text-transform: uppercase;
}
Configuration for this example
{
  "wind": {
    "spec": 1,
    "reset": "none",
    "strict": true,
    "tokens": {
      "spacingUnit": "0.25rem"
    },
    "breakpoints": {},
    "defaultTransitionTimingFunction": "ease",
    "authoredClasses": {
      "wind-demo-style-stack": true
    },
    "safelist": {
      "docs-preview": [
        "uppercase",
        "lowercase",
        "capitalize",
        "normal-case"
      ]
    }
  }
}
Authored demonstration CSS
.wind-demo-style-stack { color: #223247; border: 1px solid #b7c5d4; padding: 0.6rem 1rem; }
.wind-demo-style-stack p { margin: 0; padding: 0.45rem 0; border-bottom: 1px solid #d8e0e8; }
.wind-demo-style-stack p:last-child { border-bottom: 0; }

Style emphasis and numerals

The example contrasts italic and roman emphasis, tabular figures, and font smoothing. Numeric shape and smoothing depend on the active font and platform.

Style emphasis and numerals
HTML
<div class="wind-demo-type-grid">
  <p>Style: <em class="italic">italic</em> and <em class="not-italic">roman emphasis</em>.</p>
  <div class="wind-demo-number-grid"><span>Default digits</span><span>1,111.11</span><span>Tabular digits</span><span class="tabular-nums">1,111.11</span></div>
  <p class="antialiased">Smoothing can look different on each display. / 画面によって見え方が変わります。</p>
</div>
CSS
@layer zw-reset, zw-tokens, zfb-hi, base, components;
@layer zw-tokens {
  :root {
    --zw-spacing-unit: .25rem;
  }
}
.wind-demo-type-grid {
  max-width: 28rem;
  color: #223247;
  border: 1px solid #b7c5d4;
  padding: 1rem;
}

.wind-demo-type-grid > p {
  margin: 0 0 .85rem;
}

.wind-demo-type-grid > p:last-child {
  margin: .85rem 0 0;
  border-top: 1px solid #d8e0e8;
  padding-top: .75rem;
}

.wind-demo-number-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .35rem 1rem;
}
.italic {
  font-style: italic;
}
.not-italic {
  font-style: normal;
}
.tabular-nums {
  font-variant-numeric: tabular-nums;
}
.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
Configuration for this example
{
  "wind": {
    "spec": 1,
    "reset": "none",
    "strict": true,
    "tokens": {
      "spacingUnit": "0.25rem"
    },
    "breakpoints": {},
    "defaultTransitionTimingFunction": "ease",
    "authoredClasses": {
      "wind-demo-type-grid": true,
      "wind-demo-number-grid": true
    },
    "safelist": {
      "docs-preview": [
        "italic",
        "not-italic",
        "tabular-nums",
        "antialiased"
      ]
    }
  }
}
Authored demonstration CSS
.wind-demo-type-grid { max-width: 28rem; color: #223247; border: 1px solid #b7c5d4; padding: 1rem; }
.wind-demo-type-grid > p { margin: 0 0 0.85rem; }
.wind-demo-type-grid > p:last-child { margin: 0.85rem 0 0; border-top: 1px solid #d8e0e8; padding-top: 0.75rem; }
.wind-demo-number-grid { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 1rem; }

Custom and named values

Underline, overline, line-through, and no-underline set text-decoration-line. The four case utilities set text-transform, where normal-case restores none. italic and not-italic set font-style. tabular-nums requests tabular numeric glyphs, which only show when the chosen font supports them. antialiased sets platform-specific font-smoothing properties; browser and operating-system rendering can make the visual difference subtle. This family has fixed classes rather than named value tokens.

Related guides: Utility grammar · Variants

Catalog details

line-through

FieldValue
Catalog identifierv1.line-through
Class patternline-through
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank0
Selector shapeownElement
Spec version1
Emitter propertiestext-decoration-line

Accepted values

KindSuffixEmitted value
exactnull"line-through"

Declaration templates

PropertyValue kindFixed value
text-decoration-lineresolvednull

Catalog examples

Example classExpected declarations
line-throughtext-decoration-line: line-through

no-underline

FieldValue
Catalog identifierv1.no-underline
Class patternno-underline
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank0
Selector shapeownElement
Spec version1
Emitter propertiestext-decoration-line

Accepted values

KindSuffixEmitted value
exactnull"none"

Declaration templates

PropertyValue kindFixed value
text-decoration-lineresolvednull

Catalog examples

Example classExpected declarations
no-underlinetext-decoration-line: none

overline

FieldValue
Catalog identifierv1.overline
Class patternoverline
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank0
Selector shapeownElement
Spec version1
Emitter propertiestext-decoration-line

Accepted values

KindSuffixEmitted value
exactnull"overline"

Declaration templates

PropertyValue kindFixed value
text-decoration-lineresolvednull

Catalog examples

Example classExpected declarations
overlinetext-decoration-line: overline

underline

FieldValue
Catalog identifierv1.underline
Class patternunderline
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank0
Selector shapeownElement
Spec version1
Emitter propertiestext-decoration-line

Accepted values

KindSuffixEmitted value
exactnull"underline"

Declaration templates

PropertyValue kindFixed value
text-decoration-lineresolvednull

Catalog examples

Example classExpected declarations
underlinetext-decoration-line: underline

capitalize

FieldValue
Catalog identifierv1.capitalize
Class patterncapitalize
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank1
Selector shapeownElement
Spec version1
Emitter propertiestext-transform

Accepted values

KindSuffixEmitted value
exactnull"capitalize"

Declaration templates

PropertyValue kindFixed value
text-transformresolvednull

Catalog examples

Example classExpected declarations
capitalizetext-transform: capitalize

lowercase

FieldValue
Catalog identifierv1.lowercase
Class patternlowercase
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank1
Selector shapeownElement
Spec version1
Emitter propertiestext-transform

Accepted values

KindSuffixEmitted value
exactnull"lowercase"

Declaration templates

PropertyValue kindFixed value
text-transformresolvednull

Catalog examples

Example classExpected declarations
lowercasetext-transform: lowercase

normal-case

FieldValue
Catalog identifierv1.normal-case
Class patternnormal-case
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank1
Selector shapeownElement
Spec version1
Emitter propertiestext-transform

Accepted values

KindSuffixEmitted value
exactnull"none"

Declaration templates

PropertyValue kindFixed value
text-transformresolvednull

Catalog examples

Example classExpected declarations
normal-casetext-transform: none

uppercase

FieldValue
Catalog identifierv1.uppercase
Class patternuppercase
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank1
Selector shapeownElement
Spec version1
Emitter propertiestext-transform

Accepted values

KindSuffixEmitted value
exactnull"uppercase"

Declaration templates

PropertyValue kindFixed value
text-transformresolvednull

Catalog examples

Example classExpected declarations
uppercasetext-transform: uppercase

italic

FieldValue
Catalog identifierv1.italic
Class patternitalic
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank2
Selector shapeownElement
Spec version1
Emitter propertiesfont-style

Accepted values

KindSuffixEmitted value
exactnull"italic"

Declaration templates

PropertyValue kindFixed value
font-styleresolvednull

Catalog examples

Example classExpected declarations
italicfont-style: italic

not-italic

FieldValue
Catalog identifierv1.not-italic
Class patternnot-italic
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank2
Selector shapeownElement
Spec version1
Emitter propertiesfont-style

Accepted values

KindSuffixEmitted value
exactnull"normal"

Declaration templates

PropertyValue kindFixed value
font-styleresolvednull

Catalog examples

Example classExpected declarations
not-italicfont-style: normal

tabular-nums

FieldValue
Catalog identifierv1.tabular-nums
Class patterntabular-nums
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank3
Selector shapeownElement
Spec version1
Emitter propertiesfont-variant-numeric

Accepted values

KindSuffixEmitted value
exactnull"tabular-nums"

Declaration templates

PropertyValue kindFixed value
font-variant-numericresolvednull

Catalog examples

Example classExpected declarations
tabular-numsfont-variant-numeric: tabular-nums

antialiased

FieldValue
Catalog identifierv1.antialiased
Class patternantialiased
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranktext-style (21)
Order rank4
Selector shapeownElement
Spec version1
Emitter properties-webkit-font-smoothing, -moz-osx-font-smoothing

Accepted values

KindSuffixEmitted value
exactnull"antialiased"

Declaration templates

PropertyValue kindFixed value
-webkit-font-smoothingfixed"antialiased"
-moz-osx-font-smoothingfixed"grayscale"

Catalog examples

Example classExpected declarations
antialiased-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale

Revision History

CreatedUpdated