@dialpad/dialtone-css
Version:
Dialpad's design system
463 lines (397 loc) • 16.8 kB
text/less
//
// DIALTONE
// UTILITIES: TYPOGRAPHY
//
// These are utility typography classes for Dialpad's design system Dialtone.
// For further documentation of these and other classes,
// visit https://dialtone.dialpad.com/utilties/typography
//
// TABLE OF CONTENTS
// • FONT FAMILY
// • RESET HEADERS & PARAGRAPH MARGINS
// • FONT SIZE
// • FONT STYLE
// • FONT WEIGHT
// • LINE HEIGHT
// • LISTS
// • TEXT ALIGN
// • TEXT DECORATION
// • TEXT OVERFLOW
// • TEXT TRANSFORM
// • VERTICAL ALIGN
// • WHITESPACE
// • WORD-BREAK
// • WORD-WRAP
// • FONT VARIANT NUMERIC
//
// ============================================================================
// $ FONT FAMILY
// ----------------------------------------------------------------------------
.d-ff-custom { font-family: var(--dt-font-family-body) ; }
.d-ff-sans { font-family: var(--dt-font-family-body) ; }
.d-ff-mono { font-family: var(--dt-font-family-mono) ; }
.d-ff-marketing { font-family: var(--dt-font-family-expressive) ; }
.d-ff-unset { font-family: unset ; }
// ============================================================================
// $ RESET HEADERS & PARAGRAPH MARGINS
// ----------------------------------------------------------------------------
h1,
h2,
h3,
h4,
h5,
h6,
p,
ol,
ul {
margin-top: 0;
margin-bottom: 0;
}
// ============================================================================
// $ HEADLINE STYLES
// ----------------------------------------------------------------------------
// NOTE: the comma-delimited classes are backwards-compatible,
// and will be removed once no longer in use in the product.
// e.g. The BEMish `d-[kind]--[var]` replaces the others. If they're
// not comma-delimited then they're either new or already were ok.
.d-headline--eyebrow,
.d-headline-eyebrow {
font: var(--dt-typography-headline-eyebrow);
text-transform: var(--dt-typography-headline-eyebrow-text-case);
}
.d-headline--sm,
.d-headline-small {
font: var(--dt-typography-headline-sm);
}
.d-headline--sm-soft,
.d-headline-soft-small {
font: var(--dt-typography-headline-sm-soft);
}
.d-headline--md,
.d-headline-medium {
font: var(--dt-typography-headline-md);
}
.d-headline--sm-compact,
.d-headline-compact-small {
font: var(--dt-typography-headline-sm-compact);
}
.d-headline--sm-soft-compact,
.d-headline-compact-soft-small {
font: var(--dt-typography-headline-sm-soft-compact);
}
.d-headline--md-compact,
.d-headline-compact-medium {
font: var(--dt-typography-headline-md-compact);
}
.d-headline--lg,
.d-headline-large {
font: var(--dt-typography-headline-lg);
}
.d-headline--lg-soft {
font: var(--dt-typography-headline-lg-soft);
}
.d-headline--lg-compact,
.d-headline-compact-large {
font: var(--dt-typography-headline-lg-compact);
}
.d-headline--lg-soft-compact {
font: var(--dt-typography-headline-lg-soft-compact);
}
.d-headline--xl,
.d-headline-extra-large {
font: var(--dt-typography-headline-xl);
}
.d-headline--xl-compact {
font: var(--dt-typography-headline-xl-compact);
}
.d-headline--xxl,
.d-headline-extra-extra-large {
font: var(--dt-typography-headline-xxl);
}
.d-headline--xxl-compact {
font: var(--dt-typography-headline-xxl-compact);
}
// ============================================================================
// $ BODY STYLES
// ----------------------------------------------------------------------------
// NOTE: the comma-delimited classes are backwards-compatible,
// and will be removed once no longer in use in the product.
// e.g. The BEMish `d-[kind]--[var]` replaces the others. If they're
// not comma-delimited then they're either new or already were ok.
.d-body--md,
.d-body-base {
font: var(--dt-typography-body-md);
}
.d-body--sm,
.d-body-small {
font: var(--dt-typography-body-sm);
}
.d-body--md-compact,
.d-body-compact {
font: var(--dt-typography-body-md-compact);
}
.d-body--sm-compact,
.d-body-compact-small {
font: var(--dt-typography-body-sm-compact);
}
// ============================================================================
// $ LABEL STYLES
// ----------------------------------------------------------------------------
// NOTE: the comma-delimited classes are backwards-compatible,
// and will be removed once no longer in use in the product.
// e.g. The BEMish `d-[kind]--[var]` replaces the others. If they're
// not comma-delimited then they're either new or already were ok.
.d-label--md,
.d-label-base {
font: var(--dt-typography-label-md);
}
.d-label--sm,
.d-label-small {
font: var(--dt-typography-label-sm);
}
.d-label--md-compact,
.d-label-compact {
font: var(--dt-typography-label-md-compact);
}
.d-label--md-plain,
.d-label-plain {
font: var(--dt-typography-label-md-plain);
}
.d-label--md-plain-compact,
.d-label-compact-plain {
font: var(--dt-typography-label-md-plain-compact);
}
.d-label--sm-compact,
.d-label-compact-small {
font: var(--dt-typography-label-sm-compact);
}
.d-label--sm-plain,
.d-label-plain-small {
font: var(--dt-typography-label-sm-plain);
}
.d-label--sm-plain-compact,
.d-label-compact-plain-small {
font: var(--dt-typography-label-sm-plain-compact);
}
// ============================================================================
// $ HELPER STYLES
// ----------------------------------------------------------------------------
// NOTE: the comma-delimited classes are backwards-compatible,
// and will be removed once no longer in use in the product.
// e.g. The BEMish `d-[kind]--[var]` replaces the others. If they're
// not comma-delimited then they're either new or already were ok.
.d-helper--md,
.d-helper-base {
font: var(--dt-typography-helper-md);
}
.d-helper--sm,
.d-helper-small {
font: var(--dt-typography-helper-sm);
}
// ============================================================================
// $ CODE STYLES
// ----------------------------------------------------------------------------
// NOTE: the comma-delimited classes are backwards-compatible,
// and will be removed once no longer in use in the product.
// e.g. The BEMish `d-[kind]--[var]` replaces the others. If they're
// not comma-delimited then they're either new or already were ok.
.d-code--md,
.d-code-base {
font: var(--dt-typography-code-md);
}
.d-code--sm,
.d-code-small {
font: var(--dt-typography-code-sm);
}
// ============================================================================
// $ FONT SIZE
// ----------------------------------------------------------------------------
.d-fs-100 { font-size: var(--dt-font-size-100) ; }
.d-fs-200 { font-size: var(--dt-font-size-200) ; }
.d-fs-300 { font-size: var(--dt-font-size-300) ; }
.d-fs-400 { font-size: var(--dt-font-size-400) ; }
.d-fs-500 { font-size: var(--dt-font-size-500) ; }
.d-fs-100-mobile { font-size: var(--dt-font-size-100-mobile) ; }
.d-fs-200-mobile { font-size: var(--dt-font-size-200-mobile) ; }
.d-fs-300-mobile { font-size: var(--dt-font-size-300-mobile) ; }
.d-fs-400-mobile { font-size: var(--dt-font-size-400-mobile) ; }
.d-fs-500-mobile { font-size: var(--dt-font-size-500-mobile) ; }
.d-fs-100-tc8 { font-size: var(--dt-font-size-100-tc8) ; }
.d-fs-200-tc8 { font-size: var(--dt-font-size-200-tc8) ; }
.d-fs-300-tc8 { font-size: var(--dt-font-size-300-tc8) ; }
.d-fs-400-tc8 { font-size: var(--dt-font-size-400-tc8) ; }
.d-fs-500-tc8 { font-size: var(--dt-font-size-500-tc8) ; }
.d-fs-100-tv { font-size: var(--dt-font-size-100-tv) ; }
.d-fs-200-tv { font-size: var(--dt-font-size-200-tv) ; }
.d-fs-300-tv { font-size: var(--dt-font-size-300-tv) ; }
.d-fs-400-tv { font-size: var(--dt-font-size-400-tv) ; }
.d-fs-500-tv { font-size: var(--dt-font-size-500-tv) ; }
// TODO: deprecate these `d-headline##` classes once no longer in product use
.d-headline10 { .d-headline--eyebrow(); }
.d-headline24 { .d-headline--lg(); }
.d-headline28 { .d-headline--xl(); }
.d-headline32 { .d-headline--xl(); }
.d-headline36 { .d-headline--xl(); }
.d-headline42 { .d-headline--xxl(); }
.d-headline48 { .d-headline--xxl(); }
.d-headline54 { .d-headline--xxl(); }
// ============================================================================
// $$ FONT STYLE
// ----------------------------------------------------------------------------
.d-fs-normal { font-style: normal ; }
.d-fs-italic { font-style: italic ; }
.d-fs-unset { font-style: unset ; }
// ============================================================================
// $$ FONT WEIGHT
// ----------------------------------------------------------------------------
.d-fw-normal { font-weight: var(--dt-font-weight-normal) ; }
.d-fw-medium { font-weight: var(--dt-font-weight-medium) ; }
.d-fw-semibold { font-weight: var(--dt-font-weight-semi-bold) ; }
.d-fw-bold { font-weight: var(--dt-font-weight-bold) ; }
.d-fw-unset { font-weight: unset ; }
// ============================================================================
// $ LINE HEIGHT
// ----------------------------------------------------------------------------
.d-lh0 { line-height: var(--lh0) ; }
.d-lh1 { line-height: var(--lh1) ; }
.d-lh2 { line-height: var(--lh2) ; }
.d-lh4 { line-height: var(--lh4) ; }
.d-lh6 { line-height: var(--lh6) ; }
.d-lh8 { line-height: var(--lh8) ; }
.d-lh12 { line-height: var(--lh12) ; }
.d-lh16 { line-height: var(--lh16) ; }
.d-lh20 { line-height: var(--lh20) ; }
.d-lh24 { line-height: var(--lh24) ; }
.d-lh-100 { line-height: var(--dt-font-line-height-100) ; }
.d-lh-200 { line-height: var(--dt-font-line-height-200) ; }
.d-lh-300 { line-height: var(--dt-font-line-height-300) ; }
.d-lh-400 { line-height: var(--dt-font-line-height-400) ; }
.d-lh-500 { line-height: var(--dt-font-line-height-500) ; }
.d-lh-600 { line-height: var(--dt-font-line-height-600) ; }
.d-lh-unset { line-height: unset ; }
// ============================================================================
// $ LISTS
// ----------------------------------------------------------------------------
.d-ls-reset {
// We want to reset everything when applied
&,
li,
ol,
ul {
margin: 0;
padding: 0;
.d-ls-none();
}
}
.d-ls-none { list-style: none ; }
.d-lst-disc { list-style-type: disc ; }
.d-lst-circle { list-style-type: circle ; }
.d-lst-content { list-style-type: var(--ls-content) ; }
.d-lst-decimal { list-style-type: decimal ; }
.d-lst-none { list-style-type: none ; }
// ============================================================================
// $$ TEXT ALIGN
// ----------------------------------------------------------------------------
.d-ta-left { text-align: left ; }
.d-ta-right { text-align: right ; }
.d-ta-center { text-align: center ; }
.d-ta-justify { text-align: justify ; }
.d-ta-unset { text-align: unset ; }
// ============================================================================
// $$ TEXT DECORATION
// ----------------------------------------------------------------------------
.d-td-none { text-decoration: none ; }
.d-td-underline {
text-decoration: underline ;
text-underline-offset: calc(var(--dt-size-border-300) - var(--dt-size-border-100)) ;
text-decoration-thickness: var(--dt-size-border-50) ;
}
.d-td-dotted {
text-decoration: underline dotted ;
text-underline-offset: calc(var(--dt-size-border-300) - var(--dt-size-border-100)) ;
text-decoration-thickness: var(--dt-size-border-100) ;
}
.d-td-line-through {
text-decoration: line-through ;
text-decoration-thickness: var(--dt-size-border-100) ;
}
.d-td-unset { text-decoration: unset ; }
// ============================================================================
// $$ TEXT OVERFLOW
// ----------------------------------------------------------------------------
.d-to-ellipsis { text-overflow: ellipsis ; }
.d-to-clip { text-overflow: clip ; }
.d-to-unset { text-overflow: unset ; }
// $$ OVERFLOW WRAP
// ----------------------------------------------------------------------------
.d-ow-normal { overflow-wrap: normal ; }
.d-ow-anywhere { overflow-wrap: anywhere ; }
.d-ow-break-word { overflow-wrap: break-word ; }
.d-ow-unset { overflow-wrap: unset ; }
// ============================================================================
// $$ TEXT TRANSFORM
// ----------------------------------------------------------------------------
.d-tt-uppercase { text-transform: uppercase ; }
.d-tt-lowercase { text-transform: lowercase ; }
.d-tt-capitalize { text-transform: capitalize ; }
.d-tt-full-width { text-transform: full-width ; }
.d-tt-none { text-transform: none ; }
.d-tt-unset { text-transform: unset ; }
// ============================================================================
// $$ VERTICAL ALIGN
// ----------------------------------------------------------------------------
.d-va-baseline { vertical-align: baseline ; }
.d-va-top { vertical-align: top ; }
.d-va-bottom { vertical-align: bottom ; }
.d-va-text-top { vertical-align: text-top ; }
.d-va-text-bottom { vertical-align: text-bottom ; }
.d-va-middle { vertical-align: middle ; }
.d-va-sub { vertical-align: sub ; }
.d-va-super { vertical-align: super ; }
.d-va-unset { vertical-align: unset ; }
// ============================================================================
// $$ WHITESPACE
// ----------------------------------------------------------------------------
.d-ws-normal { white-space: normal ; }
.d-ws-nowrap { white-space: nowrap ; }
.d-ws-pre { white-space: pre ; }
.d-ws-pre-line { white-space: pre-line ; }
.d-ws-pre-wrap { white-space: pre-wrap ; }
.d-ws-break-spaces { white-space: break-spaces ; }
.d-ws-unset { white-space: unset ; }
// ============================================================================
// $$ WORD BREAK
// ----------------------------------------------------------------------------
.d-wb-normal { word-break: normal ; }
.d-wb-break-all { word-break: break-all ; }
.d-wb-break-word { word-break: break-word ; }
.d-wb-keep-all { word-break: keep-all ; }
.d-wb-unset { word-break: unset ; }
// ============================================================================
// $$ WORD WRAP
// ----------------------------------------------------------------------------
.d-ww-normal { word-wrap: normal ; }
.d-ww-break-word { word-wrap: break-word ; }
.d-ww-anywhere { word-wrap: anywhere ; }
.d-ww-initial { word-wrap: initial ; }
.d-ww-inherit { word-wrap: inherit ; }
// Unsure what to do with this
// $$ TRUNCATE
// ----------------------------------------------------------------------------
.d-truncate {
overflow: hidden ;
white-space: nowrap ;
text-overflow: ellipsis ;
}
// ============================================================================
// $$ FONT VARIANT NUMERIC
// ----------------------------------------------------------------------------
.d-fvn-normal { font-variant-numeric: normal ; }
.d-fvn-ordinal { font-variant-numeric: ordinal ; }
.d-fvn-slashed-zero { font-variant-numeric: slashed-zero ; }
.d-fvn-lining { font-variant-numeric: lining-nums ; }
.d-fvn-proportional { font-variant-numeric: proportional-nums ; }
.d-fvn-tabular { font-variant-numeric: tabular-nums ; }
.d-fvn-diagonal { font-variant-numeric: diagonal-fractions ; }
.d-fvn-stacked { font-variant-numeric: stacked-fractions ; }
.d-fvn-unset { font-variant-numeric: unset ; }