Mark | Description |
---|---|
✅ | Public functions, mixins, placeholders, and variables |
❌ | Private items - not supported outside package's build |
Deprecated items - may not be available in future releases |
- @carbon/type
- ✅carbon--type-classes [mixin]
- ✅carbon--font-families [variable]
- ✅carbon--font-family [function]
- ✅carbon--font-family [mixin]
- ✅carbon--font-weights [variable]
- ✅carbon--font-weight [function]
- ✅carbon--font-weight [mixin]
- ✅carbon--font-face-mono [mixin]
- ✅prefix [variable]
- ✅carbon--type-reset [mixin]
- ✅carbon--default-type [mixin]
- ✅carbon--font-face-sans [mixin]
- ✅carbon--get-type-size [function]
- ✅carbon--type-scale [variable]
- ✅carbon--type-scale [function]
- ✅carbon--type-scale [mixin]
- ✅carbon--font-size [mixin]
- ✅carbon--font-face-serif [mixin]
- ✅carbon--font-display [variable]
- ✅caption-01 [variable]
- ✅label-01 [variable]
- ✅helper-text-01 [variable]
- ✅body-short-01 [variable]
- ✅body-long-01 [variable]
- ✅body-short-02 [variable]
- ✅body-long-02 [variable]
- ✅code-01 [variable]
- ✅code-02 [variable]
- ✅heading-01 [variable]
- ✅productive-heading-01 [variable]
- ✅heading-02 [variable]
- ✅productive-heading-02 [variable]
- ✅productive-heading-03 [variable]
- ✅productive-heading-04 [variable]
- ✅productive-heading-05 [variable]
- ✅productive-heading-06 [variable]
- ✅productive-heading-07 [variable]
- ✅expressive-heading-01 [variable]
- ✅expressive-heading-02 [variable]
- ✅expressive-heading-03 [variable]
- ✅expressive-heading-04 [variable]
- ✅expressive-heading-05 [variable]
- ✅expressive-heading-06 [variable]
- ✅expressive-paragraph-01 [variable]
- ✅quotation-01 [variable]
- ✅quotation-02 [variable]
- ✅display-01 [variable]
- ✅display-02 [variable]
- ✅display-03 [variable]
- ✅display-04 [variable]
- ✅tokens [variable]
- ✅properties [mixin]
- ✅strip-unit [function]
- ✅fluid-type [mixin]
- ✅fluid-type-size [mixin]
- ❌custom-property-prefix [variable]
- ❌custom-properties [mixin]
- ✅carbon--type-style [mixin]
Create type classes for font families, weights, styles
Source code
@mixin carbon--type-classes() {
// Font families
@each $name, $value in $carbon--font-families {
.#{$prefix}--type-#{$name} {
font-family: $value;
}
}
// Font weights
@each $name, $value in $carbon--font-weights {
.#{$prefix}--type-#{$name} {
font-weight: $value;
}
}
// Font styles
.#{$prefix}--type-italic {
font-style: italic;
}
// Type styles
@each $name, $value in $tokens {
.#{$prefix}--type-#{$name} {
@include carbon--type-style($name, map-has-key($value, breakpoints));
}
}
}
- Group: @carbon/type
- Requires:
Font family fallbacks for: IBM Plex Mono, IBM Plex Sans, IBM Plex Sans Condensed, IBM Plex Sans Hebrew, and IBM Plex Serif
Source code
$carbon--font-families: (
'mono': unquote("'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace"),
'sans': unquote("'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif"),
'sans-condensed': unquote("'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif"),
'sans-hebrew': unquote("'IBM Plex Sans Hebrew', 'Helvetica Hebrew', 'Arial Hebrew', sans-serif"),
'serif': unquote("'IBM Plex Serif', 'Georgia', Times, serif"),
);
- Group: @carbon/type
- Type:
Map
- Used by:
Get the font-family for an IBM Plex font
Source code
@function carbon--font-family($name) {
@return map-get($carbon--font-families, $name);
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$name |
— | String |
— |
- Group: @carbon/type
- Returns:
String
- Requires:
- Used by:
Include the font-family
definition for the given name in your selector
Source code
@mixin carbon--font-family($name) {
font-family: carbon--font-family($name);
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$name |
— | String |
— |
- Group: @carbon/type
- Requires:
Suggested font weights to be used in product
Source code
$carbon--font-weights: (
'light': 300,
'regular': 400,
'semibold': 600,
);
- Group: @carbon/type
- Type:
Map
- Used by:
Retrieve the font-weight value for a given name
Source code
@function carbon--font-weight($weight) {
@return map-get($carbon--font-weights, $weight);
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$weight |
— | String |
— |
- Group: @carbon/type
- Returns:
Number
- Requires:
- Used by:
Set the font-weight
property with the value for a given name
Source code
@mixin carbon--font-weight($weight) {
font-weight: carbon--font-weight($weight);
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$weight |
— | String |
— |
- Group: @carbon/type
- Requires:
- Used by:
Mono @font-face
's
Source code
@mixin carbon--font-face-mono() {
// .woff support for IE11
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light Italic'), local('IBMPlexMono-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSflV1gMoW.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Italic'), local('IBMPlexMono-Italic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6pfjptAgt5VM-kVkqdyU8n1ioa1Xdm.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold Italic'), local(
'IBMPlexMono-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSClN1gMoW.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light'), local('IBMPlexMono-Light'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3oQIwlBFhA.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono'), local('IBMPlexMono'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F63fjptAgt5VM-kVkqdyU8n1i8q0Q.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold'), local('IBMPlexMono-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3vAOwlBFhA.woff)
format('woff');
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light Italic'), local('IBMPlexMono-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSflV1jcoQPttoz6Pz.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light Italic'), local('IBMPlexMono-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSflV1hMoQPttoz6Pz.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light Italic'), local('IBMPlexMono-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSflV1j8oQPttoz6Pz.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light Italic'), local('IBMPlexMono-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSflV1jsoQPttoz6Pz.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light Italic'), local('IBMPlexMono-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSflV1gMoQPttozw.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Italic'), local('IBMPlexMono-Italic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6pfjptAgt5VM-kVkqdyU8n1ioa2HdgregdFOFh.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Italic'), local('IBMPlexMono-Italic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6pfjptAgt5VM-kVkqdyU8n1ioa0XdgregdFOFh.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Italic'), local('IBMPlexMono-Italic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6pfjptAgt5VM-kVkqdyU8n1ioa2ndgregdFOFh.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Italic'), local('IBMPlexMono-Italic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6pfjptAgt5VM-kVkqdyU8n1ioa23dgregdFOFh.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Italic'), local('IBMPlexMono-Italic'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6pfjptAgt5VM-kVkqdyU8n1ioa1XdgregdFA.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold Italic'), local(
'IBMPlexMono-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSClN1jcoQPttoz6Pz.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold Italic'), local(
'IBMPlexMono-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSClN1hMoQPttoz6Pz.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold Italic'), local(
'IBMPlexMono-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSClN1j8oQPttoz6Pz.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold Italic'), local(
'IBMPlexMono-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSClN1jsoQPttoz6Pz.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold Italic'), local(
'IBMPlexMono-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6sfjptAgt5VM-kVkqdyU8n1ioSClN1gMoQPttozw.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light'), local('IBMPlexMono-Light'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3oQIwl1FgsAXHNlYzg.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light'), local('IBMPlexMono-Light'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3oQIwlRFgsAXHNlYzg.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light'), local('IBMPlexMono-Light'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3oQIwl9FgsAXHNlYzg.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light'), local('IBMPlexMono-Light'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3oQIwl5FgsAXHNlYzg.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Mono Light'), local('IBMPlexMono-Light'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3oQIwlBFgsAXHNk.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono'), local('IBMPlexMono'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F63fjptAgt5VM-kVkqdyU8n1iIq131nj-otFQ.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono'), local('IBMPlexMono'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F63fjptAgt5VM-kVkqdyU8n1isq131nj-otFQ.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono'), local('IBMPlexMono'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F63fjptAgt5VM-kVkqdyU8n1iAq131nj-otFQ.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono'), local('IBMPlexMono'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F63fjptAgt5VM-kVkqdyU8n1iEq131nj-otFQ.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Mono'), local('IBMPlexMono'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F63fjptAgt5VM-kVkqdyU8n1i8q131nj-o.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold'), local('IBMPlexMono-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3vAOwl1FgsAXHNlYzg.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold'), local('IBMPlexMono-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3vAOwlRFgsAXHNlYzg.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold'), local('IBMPlexMono-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3vAOwl9FgsAXHNlYzg.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold'), local('IBMPlexMono-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3vAOwl5FgsAXHNlYzg.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Mono';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Mono SemiBold'), local('IBMPlexMono-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3vAOwlBFgsAXHNk.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
}
- Group: @carbon/type
- Requires:
Source code
$prefix: 'bx';
- Group: @carbon/type
- Type:
String
- Used by:
Include a type reset for a given body and mono font family
Source code
@mixin carbon--type-reset(
$base-font-size: $carbon--base-font-size,
$body-font-family: carbon--font-family('sans'),
$mono-font-family: carbon--font-family('mono')
) {
html {
font-size: $base-font-size;
}
body {
font-family: $body-font-family;
@include carbon--font-weight('regular');
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: $mono-font-family;
}
strong {
@include carbon--font-weight('semibold');
}
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$base-font-size |
The base font size for your document | Number |
$carbon--base-font-size |
$body-font-family |
The font family used on the <body> element |
String |
carbon--font-family('sans') |
$mono-font-family |
The font family used on elements that require mono fonts, like the <code> element |
String |
carbon--font-family('mono') |
- Group: @carbon/type
- Requires:
Include default type styles
Source code
@mixin carbon--default-type() {
h1 {
@include carbon--type-style('productive-heading-06');
}
h2 {
@include carbon--type-style('productive-heading-05');
}
h3 {
@include carbon--type-style('productive-heading-04');
}
h4 {
@include carbon--type-style('productive-heading-03');
}
h5 {
@include carbon--type-style('productive-heading-02');
}
h6 {
@include carbon--type-style('productive-heading-01');
}
p {
@include carbon--type-style('body-long-02');
}
a {
color: #0062ff;
}
em {
font-style: italic;
}
}
- Group: @carbon/type
- Requires:
Sans @font-face
's
Source code
@mixin carbon--font-face-sans() {
// .woff support for IE11
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light Italic'), local('IBMPlexSans-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmvIRcdvfo.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Italic'), local('IBMPlexSans-Italic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX-KVElMYYaJe8bpLHnCwDKhdTuF6ZP.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold Italic'), local(
'IBMPlexSans-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmyIJcdvfo.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light'), local('IBMPlexSans-Light'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjXr8AIFscg.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans'), local('IBMPlexSans'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYXgKVElMYYaJe8bpLHnCwDKhdHeEw.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold'), local('IBMPlexSans-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjQ76AIFscg.woff)
format('woff');
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light Italic'), local('IBMPlexSans-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmvIRce_fuJGl18QRY.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light Italic'), local('IBMPlexSans-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmvIRccvfuJGl18QRY.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light Italic'), local('IBMPlexSans-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmvIRcdffuJGl18QRY.woff2)
format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light Italic'), local('IBMPlexSans-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmvIRceffuJGl18QRY.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light Italic'), local('IBMPlexSans-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmvIRcePfuJGl18QRY.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light Italic'), local('IBMPlexSans-LightItalic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmvIRcdvfuJGl18Q.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Italic'), local('IBMPlexSans-Italic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX-KVElMYYaJe8bpLHnCwDKhdTuGqZJW9XjDlN8.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Italic'), local('IBMPlexSans-Italic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX-KVElMYYaJe8bpLHnCwDKhdTuE6ZJW9XjDlN8.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Italic'), local('IBMPlexSans-Italic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX-KVElMYYaJe8bpLHnCwDKhdTuFKZJW9XjDlN8.woff2)
format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Italic'), local('IBMPlexSans-Italic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX-KVElMYYaJe8bpLHnCwDKhdTuGKZJW9XjDlN8.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Italic'), local('IBMPlexSans-Italic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX-KVElMYYaJe8bpLHnCwDKhdTuGaZJW9XjDlN8.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Italic'), local('IBMPlexSans-Italic'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX-KVElMYYaJe8bpLHnCwDKhdTuF6ZJW9XjDg.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold Italic'), local(
'IBMPlexSans-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmyIJce_fuJGl18QRY.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold Italic'), local(
'IBMPlexSans-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmyIJccvfuJGl18QRY.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold Italic'), local(
'IBMPlexSans-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmyIJcdffuJGl18QRY.woff2)
format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold Italic'), local(
'IBMPlexSans-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmyIJceffuJGl18QRY.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold Italic'), local(
'IBMPlexSans-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmyIJcePfuJGl18QRY.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Sans';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold Italic'), local(
'IBMPlexSans-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmyIJcdvfuJGl18Q.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light'), local('IBMPlexSans-Light'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjXr8AIxsdP3pBmtF8A.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light'), local('IBMPlexSans-Light'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjXr8AIVsdP3pBmtF8A.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light'), local('IBMPlexSans-Light'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjXr8AIJsdP3pBmtF8A.woff2)
format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light'), local('IBMPlexSans-Light'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjXr8AI5sdP3pBmtF8A.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light'), local('IBMPlexSans-Light'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjXr8AI9sdP3pBmtF8A.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Sans Light'), local('IBMPlexSans-Light'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjXr8AIFsdP3pBms.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans'), local('IBMPlexSans'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYXgKVElMYYaJe8bpLHnCwDKhdzeFaxOedfTDw.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans'), local('IBMPlexSans'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYXgKVElMYYaJe8bpLHnCwDKhdXeFaxOedfTDw.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans'), local('IBMPlexSans'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYXgKVElMYYaJe8bpLHnCwDKhdLeFaxOedfTDw.woff2)
format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans'), local('IBMPlexSans'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYXgKVElMYYaJe8bpLHnCwDKhd7eFaxOedfTDw.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans'), local('IBMPlexSans'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYXgKVElMYYaJe8bpLHnCwDKhd_eFaxOedfTDw.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Sans'), local('IBMPlexSans'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYXgKVElMYYaJe8bpLHnCwDKhdHeFaxOedc.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold'), local('IBMPlexSans-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjQ76AIxsdP3pBmtF8A.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold'), local('IBMPlexSans-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjQ76AIVsdP3pBmtF8A.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold'), local('IBMPlexSans-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjQ76AIJsdP3pBmtF8A.woff2)
format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold'), local('IBMPlexSans-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjQ76AI5sdP3pBmtF8A.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold'), local('IBMPlexSans-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjQ76AI9sdP3pBmtF8A.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Sans';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Sans SemiBold'), local('IBMPlexSans-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX9KVElMYYaJe8bpLHnCwDKjQ76AIFsdP3pBms.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
}
- Group: @carbon/type
- Requires:
Compute the type size for the given type scale step
Source code
@function carbon--get-type-size($step) {
@if $step == 1 {
@return 12px;
}
// Yn = Yn-1 + {INT[(n-2)/4] + 1} * 2
@return carbon--get-type-size($step - 1) + (floor(($step - 2) / 4) + 1) * 2;
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$step |
— | Number |
— |
- Group: @carbon/type
- Returns:
Number
In px
Type scole follows a custom formula for determining each step size and supports sizes from 12px to 92px
Source code
$carbon--type-scale: ();
- Group: @carbon/type
- Type:
Map
- Aliased:
carbon--font-size
- Used by:
Get the value of a specific step in the typescale
Source code
@function carbon--type-scale($step) {
@return nth($carbon--type-scale, $step);
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$step |
— | Number |
— |
- Group: @carbon/type
- Returns:
Number
In rem - Requires:
- Used by:
Set the font-size value of a selector with the value at the given $step
Source code
@mixin carbon--type-scale($step) {
font-size: carbon--type-scale($step);
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$step |
— | Number |
— |
- Group: @carbon/type
- Requires:
Alias of type-scale
mixin.
Source code
@mixin carbon--font-size($step) {
font-size: carbon--type-scale($step);
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$step |
— | Number |
— |
- Group: @carbon/type
- Alias:
carbon--type-scale
- Requires:
Serif @font-face
's
Source code
@mixin carbon--font-face-serif() {
// .woff support for IE11
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light Italic'), local(
'IBMPlexSerif-LightItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa454xm1npiw.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Italic'), local('IBMPlexSerif-Italic'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizBREVNn1dOx-zrZ2X3pZvkTiUa6zUTiA.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold Italic'), local(
'IBMPlexSerif-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa4-o3m1npiw.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light'), local('IBMPlexSerif-Light'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi20-SI0q10.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif'), local('IBMPlexSerif'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizDREVNn1dOx-zrZ2X3pZvkTiUf2zE.woff)
format('woff');
}
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold'), local('IBMPlexSerif-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi3A_yI0q10.woff)
format('woff');
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light Italic'), local(
'IBMPlexSerif-LightItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa454xm1TpjfGj7oaMBg.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light Italic'), local(
'IBMPlexSerif-LightItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa454xm13pjfGj7oaMBg.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light Italic'), local(
'IBMPlexSerif-LightItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa454xm1bpjfGj7oaMBg.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light Italic'), local(
'IBMPlexSerif-LightItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa454xm1fpjfGj7oaMBg.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light Italic'), local(
'IBMPlexSerif-LightItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa454xm1npjfGj7oY.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Italic'), local('IBMPlexSerif-Italic'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizBREVNn1dOx-zrZ2X3pZvkTiUa6zgTjnTLgNuZ5w.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Italic'), local('IBMPlexSerif-Italic'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizBREVNn1dOx-zrZ2X3pZvkTiUa6zETjnTLgNuZ5w.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Italic'), local('IBMPlexSerif-Italic'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizBREVNn1dOx-zrZ2X3pZvkTiUa6zoTjnTLgNuZ5w.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Italic'), local('IBMPlexSerif-Italic'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizBREVNn1dOx-zrZ2X3pZvkTiUa6zsTjnTLgNuZ5w.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Italic'), local('IBMPlexSerif-Italic'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizBREVNn1dOx-zrZ2X3pZvkTiUa6zUTjnTLgNs.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold Italic'), local(
'IBMPlexSerif-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa4-o3m1TpjfGj7oaMBg.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold Italic'), local(
'IBMPlexSerif-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa4-o3m13pjfGj7oaMBg.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold Italic'), local(
'IBMPlexSerif-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa4-o3m1bpjfGj7oaMBg.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold Italic'), local(
'IBMPlexSerif-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa4-o3m1fpjfGj7oaMBg.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Serif';
font-style: italic;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold Italic'), local(
'IBMPlexSerif-SemiBoldItalic'
),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizGREVNn1dOx-zrZ2X3pZvkTiUa4-o3m1npjfGj7oY.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light'), local('IBMPlexSerif-Light'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi20-SI5q1vjitOh3oc.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light'), local('IBMPlexSerif-Light'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi20-SIwq1vjitOh3oc.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light'), local('IBMPlexSerif-Light'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi20-SI7q1vjitOh3oc.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light'), local('IBMPlexSerif-Light'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi20-SI6q1vjitOh3oc.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 300;
font-display: $carbon--font-display;
src: local('IBM Plex Serif Light'), local('IBMPlexSerif-Light'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi20-SI0q1vjitOh.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif'), local('IBMPlexSerif'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizDREVNn1dOx-zrZ2X3pZvkTiUS2zcZiVbJsNo.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif'), local('IBMPlexSerif'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizDREVNn1dOx-zrZ2X3pZvkTiUb2zcZiVbJsNo.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif'), local('IBMPlexSerif'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizDREVNn1dOx-zrZ2X3pZvkTiUQ2zcZiVbJsNo.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif'), local('IBMPlexSerif'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizDREVNn1dOx-zrZ2X3pZvkTiUR2zcZiVbJsNo.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 400;
font-display: $carbon--font-display;
src: local('IBM Plex Serif'), local('IBMPlexSerif'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizDREVNn1dOx-zrZ2X3pZvkTiUf2zcZiVbJ.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold'), local('IBMPlexSerif-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi3A_yI5q1vjitOh3oc.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold'), local('IBMPlexSerif-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi3A_yIwq1vjitOh3oc.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold'), local('IBMPlexSerif-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi3A_yI7q1vjitOh3oc.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold'), local('IBMPlexSerif-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi3A_yI6q1vjitOh3oc.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'IBM Plex Serif';
font-style: normal;
font-weight: 600;
font-display: $carbon--font-display;
src: local('IBM Plex Serif SemiBold'), local('IBMPlexSerif-SemiBold'),
url(https://fonts.gstatic.com/s/ibmplexserif/v7/jizAREVNn1dOx-zrZ2X3pZvkTi3A_yI0q1vjitOh.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
U+2212, U+2215, U+FEFF, U+FFFD;
}
}
- Group: @carbon/type
- Requires:
Defines how font files are loaded and displayed by the browser
Source code
$carbon--font-display: auto;
- Group: @carbon/type
- Used by:
- Links:
Source code
$caption-01: (
font-size: carbon--type-scale(1),
font-weight: carbon--font-weight('regular'),
line-height: carbon--rem(16px),
letter-spacing: 0.32px,
);
- Group: @carbon/type
- Type:
Map
Source code
$label-01: (
font-size: carbon--type-scale(1),
font-weight: carbon--font-weight('regular'),
line-height: carbon--rem(16px),
letter-spacing: 0.32px,
);
- Group: @carbon/type
- Type:
Map
Source code
$helper-text-01: (
font-size: carbon--type-scale(1),
line-height: carbon--rem(16px),
letter-spacing: 0.32px,
);
- Group: @carbon/type
- Type:
Map
Source code
$body-short-01: (
font-size: carbon--type-scale(2),
font-weight: carbon--font-weight('regular'),
line-height: carbon--rem(18px),
letter-spacing: 0.16px,
);
- Group: @carbon/type
- Type:
Map
Source code
$body-long-01: (
font-size: carbon--type-scale(2),
font-weight: carbon--font-weight('regular'),
line-height: carbon--rem(20px),
letter-spacing: 0.16px,
);
- Group: @carbon/type
- Type:
Map
Source code
$body-short-02: (
font-size: carbon--type-scale(3),
font-weight: carbon--font-weight('regular'),
line-height: carbon--rem(22px),
letter-spacing: 0,
);
- Group: @carbon/type
- Type:
Map
Source code
$body-long-02: (
font-size: carbon--type-scale(3),
font-weight: carbon--font-weight('regular'),
line-height: carbon--rem(24px),
letter-spacing: 0,
);
- Group: @carbon/type
- Type:
Map
Source code
$code-01: (
font-family: carbon--font-family('mono'),
font-size: carbon--type-scale(1),
font-weight: carbon--font-weight('regular'),
line-height: carbon--rem(16px),
letter-spacing: 0.32px,
);
- Group: @carbon/type
- Type:
Map
Source code
$code-02: (
font-family: carbon--font-family('mono'),
font-size: carbon--type-scale(2),
font-weight: carbon--font-weight('regular'),
line-height: carbon--rem(20px),
letter-spacing: 0.32px,
);
- Group: @carbon/type
- Type:
Map
Source code
$heading-01: (
font-size: carbon--type-scale(2),
font-weight: carbon--font-weight('semibold'),
line-height: carbon--rem(18px),
letter-spacing: 0.16px,
);
- Group: @carbon/type
- Type:
Map
Source code
$productive-heading-01: $heading-01;
- Group: @carbon/type
- Type:
Map
Source code
$heading-02: (
font-size: carbon--type-scale(3),
font-weight: carbon--font-weight('semibold'),
line-height: carbon--rem(22px),
letter-spacing: 0,
);
- Group: @carbon/type
- Type:
Map
Source code
$productive-heading-02: $heading-02;
- Group: @carbon/type
- Type:
Map
Source code
$productive-heading-03: (
font-size: carbon--type-scale(5),
font-weight: carbon--font-weight('regular'),
line-height: carbon--rem(26px),
letter-spacing: 0,
);
- Group: @carbon/type
- Type:
Map
Source code
$productive-heading-04: (
font-size: carbon--type-scale(7),
font-weight: carbon--font-weight('regular'),
line-height: carbon--rem(36px),
letter-spacing: 0,
);
- Group: @carbon/type
- Type:
Map
Source code
$productive-heading-05: (
font-size: carbon--type-scale(8),
font-weight: carbon--font-weight('regular'),
line-height: carbon--rem(40px),
letter-spacing: 0,
);
- Group: @carbon/type
- Type:
Map
Source code
$productive-heading-06: (
font-size: carbon--type-scale(8),
font-weight: carbon--font-weight('light'),
line-height: carbon--rem(50px),
letter-spacing: 0,
);
- Group: @carbon/type
- Type:
Map
Source code
$productive-heading-07: (
font-size: carbon--type-scale(10),
font-weight: carbon--font-weight('light'),
line-height: carbon--rem(64px),
letter-spacing: 0,
);
- Group: @carbon/type
- Type:
Map
Source code
$expressive-heading-01: map-merge(
$heading-01,
(
line-height: carbon--rem(20px),
)
);
- Group: @carbon/type
- Type:
Map
Source code
$expressive-heading-02: map-merge(
$heading-02,
(
line-height: carbon--rem(24px),
)
);
- Group: @carbon/type
- Type:
Map
Source code
$expressive-heading-03: (
font-size: carbon--type-scale(5),
font-weight: carbon--font-weight('regular'),
line-height: 130%,
letter-spacing: 0,
breakpoints: (
xlg: (
font-size: carbon--type-scale(5),
line-height: 125%,
),
max: (
font-size: carbon--type-scale(6),
),
),
);
- Group: @carbon/type
- Type:
Map
Source code
$expressive-heading-04: (
font-size: carbon--type-scale(7),
font-weight: carbon--font-weight('regular'),
line-height: 129%,
letter-spacing: 0,
breakpoints: (
xlg: (
font-size: carbon--type-scale(7),
line-height: 125%,
),
max: (
font-size: carbon--type-scale(8),
),
),
);
- Group: @carbon/type
- Type:
Map
Source code
$expressive-heading-05: (
font-size: carbon--type-scale(8),
font-weight: carbon--font-weight('regular'),
line-height: 125%,
letter-spacing: 0,
breakpoints: (
md: (
font-size: carbon--type-scale(9),
line-height: 122%,
),
lg: (
font-size: carbon--type-scale(10),
line-height: 119%,
),
xlg: (
font-size: carbon--type-scale(11),
line-height: 117%,
),
max: (
font-size: carbon--type-scale(13),
),
),
);
- Group: @carbon/type
- Type:
Map
Source code
$expressive-heading-06: (
font-size: carbon--type-scale(8),
font-weight: carbon--font-weight('semibold'),
line-height: 125%,
letter-spacing: 0,
breakpoints: (
md: (
font-size: carbon--type-scale(9),
line-height: 122%,
),
lg: (
font-size: carbon--type-scale(10),
line-height: 119%,
),
xlg: (
font-size: carbon--type-scale(11),
line-height: 117%,
),
max: (
font-size: carbon--type-scale(13),
),
),
);
- Group: @carbon/type
- Type:
Map
Source code
$expressive-paragraph-01: (
font-size: carbon--type-scale(6),
font-weight: carbon--font-weight('light'),
line-height: 125%,
letter-spacing: 0,
breakpoints: (
lg: (
font-size: carbon--type-scale(7),
line-height: 129%,
),
max: (
font-size: carbon--type-scale(8),
line-height: 125%,
),
),
);
- Group: @carbon/type
- Type:
Map
Source code
$quotation-01: (
font-size: carbon--type-scale(5),
font-weight: carbon--font-weight('regular'),
line-height: 130%,
letter-spacing: 0,
breakpoints: (
md: (
font-size: carbon--type-scale(5),
),
lg: (
font-size: carbon--type-scale(6),
line-height: 125%,
),
xlg: (
font-size: carbon--type-scale(7),
line-height: 129%,
),
max: (
font-size: carbon--type-scale(8),
line-height: 125%,
),
),
);
- Group: @carbon/type
- Type:
Map
Source code
$quotation-02: (
font-size: carbon--type-scale(8),
font-weight: carbon--font-weight('light'),
line-height: 125%,
letter-spacing: 0,
breakpoints: (
md: (
font-size: carbon--type-scale(9),
line-height: 122%,
),
lg: (
font-size: carbon--type-scale(10),
line-height: 119%,
),
xlg: (
font-size: carbon--type-scale(11),
line-height: 117%,
),
max: (
font-size: carbon--type-scale(13),
),
),
);
- Group: @carbon/type
- Type:
Map
Source code
$display-01: (
font-size: carbon--type-scale(10),
font-weight: carbon--font-weight('light'),
line-height: 119%,
letter-spacing: 0,
breakpoints: (
md: (
font-size: carbon--type-scale(10),
),
lg: (
font-size: carbon--type-scale(12),
),
xlg: (
font-size: carbon--type-scale(13),
line-height: 117%,
),
max: (
font-size: carbon--type-scale(15),
line-height: 113%,
),
),
);
- Group: @carbon/type
- Type:
Map
Source code
$display-02: (
font-size: carbon--type-scale(10),
font-weight: carbon--font-weight('semibold'),
line-height: 119%,
letter-spacing: 0,
breakpoints: (
md: (
font-size: carbon--type-scale(10),
),
lg: (
font-size: carbon--type-scale(12),
),
xlg: (
font-size: carbon--type-scale(13),
line-height: 116%,
),
max: (
font-size: carbon--type-scale(15),
line-height: 113%,
),
),
);
- Group: @carbon/type
- Type:
Map
Source code
$display-03: (
font-size: carbon--type-scale(10),
font-weight: carbon--font-weight('light'),
line-height: 119%,
letter-spacing: 0,
breakpoints: (
md: (
font-size: carbon--type-scale(14),
line-height: 115%,
),
lg: (
font-size: carbon--type-scale(17),
line-height: 111%,
letter-spacing: -0.64px,
),
xlg: (
font-size: carbon--type-scale(20),
line-height: 107%,
letter-spacing: -0.64px,
),
max: (
font-size: carbon--type-scale(23),
line-height: 105%,
letter-spacing: -0.96px,
),
),
);
- Group: @carbon/type
- Type:
Map
Source code
$display-04: (
font-size: carbon--type-scale(10),
font-weight: carbon--font-weight('semibold'),
line-height: 119%,
letter-spacing: 0,
breakpoints: (
md: (
font-size: carbon--type-scale(14),
line-height: 115%,
),
lg: (
font-size: carbon--type-scale(17),
line-height: 111%,
letter-spacing: -0.64px,
),
xlg: (
font-size: carbon--type-scale(20),
line-height: 107%,
letter-spacing: -0.64px,
),
max: (
font-size: carbon--type-scale(23),
line-height: 105%,
letter-spacing: -0.96px,
),
),
);
- Group: @carbon/type
- Type:
Map
Source code
$tokens: (
caption-01: $caption-01,
label-01: $label-01,
helper-text-01: $helper-text-01,
body-short-01: $body-short-01,
body-short-02: $body-short-02,
body-long-01: $body-long-01,
body-long-02: $body-long-02,
code-01: $code-01,
code-02: $code-02,
heading-01: $heading-01,
heading-02: $heading-02,
productive-heading-01: $productive-heading-01,
productive-heading-02: $productive-heading-02,
productive-heading-03: $productive-heading-03,
productive-heading-04: $productive-heading-04,
productive-heading-05: $productive-heading-05,
productive-heading-06: $productive-heading-06,
productive-heading-07: $productive-heading-07,
expressive-paragraph-01: $expressive-paragraph-01,
expressive-heading-01: $expressive-heading-01,
expressive-heading-02: $expressive-heading-02,
expressive-heading-03: $expressive-heading-03,
expressive-heading-04: $expressive-heading-04,
expressive-heading-05: $expressive-heading-05,
expressive-heading-06: $expressive-heading-06,
quotation-01: $quotation-01,
quotation-02: $quotation-02,
display-01: $display-01,
display-02: $display-02,
display-03: $display-03,
display-04: $display-04,
);
- Group: @carbon/type
- Type:
Map
- Used by:
Source code
@mixin properties($map) {
@each $name, $value in $map {
#{$name}: $value;
}
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$map |
— | Map |
— |
- Group: @carbon/type
- Used by:
Source code
@function strip-unit($value) {
@return $value / ($value * 0 + 1);
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$value |
Number with units | Number |
— |
- Group: @carbon/type
- Returns:
Number
Without units - Used by:
This helper includes fluid type styles for the given token value. Fluid type
means that the font-size
is computed using calc()
in order to be determined
by the screen size instead of a breakpoint. As a result, fluid styles should be
used with caution in fixed width contexts.
In addition, we make use of %-based line-heights so that the line-height of each
type style is computed correctly due to the dynamic nature of the font-size
.
Most of the logic for this work comes from CSS Tricks: https://css-tricks.com/snippets/css/fluid-typography/
Source code
@mixin fluid-type($type-styles, $breakpoints: $carbon--grid-breakpoints) {
// Include the initial styles for the given token by default without any
// media query guard. This includes `font-size` as a fallback in the case
// that a browser does not support `calc()`
@include properties(map-remove($type-styles, breakpoints));
// We also need to include the `sm` styles by default since they don't
// appear in the fluid styles for tokens
@include fluid-type-size($type-styles, sm, $breakpoints);
// Finally, we need to go through all the breakpoints defined in the type
// token and apply the properties and fluid type size for that given
// breakpoint
@each $name, $values in map-get($type-styles, breakpoints) {
@include carbon--breakpoint($name) {
@include properties($values);
@include fluid-type-size($type-styles, $name, $breakpoints);
}
}
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$type-styles |
The value of a given type token | Map |
— |
$breakpoints |
Custom breakpoints to use | Map |
$carbon--grid-breakpoints |
- Group: @carbon/type
- Requires:
- Used by:
Computes the fluid font-size
for a given type style and breakpoint
Source code
@mixin fluid-type-size(
$type-styles,
$name,
$breakpoints: $carbon--grid-breakpoints
) {
// Get the information about the breakpoint we're currently working in. Useful
// for getting initial width information
$breakpoint: map-get($breakpoints, $name);
// Our fluid styles are captured under the 'breakpoints' property in our type
// styles map. These define what values to treat as `max-` variables below
$fluid-sizes: map-get($type-styles, breakpoints);
$fluid-breakpoint: ();
// Special case for `sm` because the styles for small are on the type style
// directly
@if $name == sm {
$fluid-breakpoint: map-remove($type-styles, breakpoints);
} @else {
$fluid-breakpoint: map-get($fluid-sizes, $name);
}
// Initialize our font-sizes to the default size for the type style
$max-font-size: map-get($type-styles, font-size);
$min-font-size: map-get($type-styles, font-size);
@if map-has-key($fluid-breakpoint, font-size) {
$min-font-size: map-get($fluid-breakpoint, font-size);
}
// Initialize our min and max width to the width of the current breakpoint
$max-vw: map-get($breakpoint, width);
$min-vw: map-get($breakpoint, width);
// We can use `breakpoint-next` to see if there is another breakpoint we can
// use to update `max-font-size` and `max-vw` with larger values
$next-breakpoint-available: carbon--breakpoint-next($name, $breakpoints);
$next-fluid-breakpoint-name: null;
// We need to figure out what the next available fluid breakpoint is for our
// given $type-styles. In this loop we try and iterate through breakpoints
// until we either manually set $next-breakpoint-available to null or
// `breakpoint-next` returns null.
@while $next-breakpoint-available {
@if map-has-key($fluid-sizes, $next-breakpoint-available) {
$next-fluid-breakpoint-name: $next-breakpoint-available;
$next-breakpoint-available: null;
} @else {
$next-breakpoint-available: carbon--breakpoint-next(
$next-breakpoint-available,
$breakpoints
);
}
}
// If we have found the next available fluid breakpoint name, then we know
// that we have values that we can use to set max-font-size and max-vw as both
// values derive from the next breakpoint
@if $next-fluid-breakpoint-name {
$next-fluid-breakpoint: map-get($breakpoints, $next-fluid-breakpoint-name);
$max-font-size: map-get(
map-get($fluid-sizes, $next-fluid-breakpoint-name),
font-size
);
$max-vw: map-get($next-fluid-breakpoint, width);
// prettier-ignore
font-size: calc(#{$min-font-size} +
#{strip-unit($max-font-size - $min-font-size)} *
((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})
);
} @else {
// Otherwise, just default to setting the font size found from the type
// style or the given fluid breakpoint in the type style
font-size: $min-font-size;
}
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$type-styles |
The styles for a given token | Map |
— |
$name |
The name of the breakpoint to which we apply the fluid | String |
— |
$breakpoints |
The breakpoints for the grid system | Map |
$carbon--grid-breakpoints |
- Group: @carbon/type
- Requires:
- Used by:
Source code
$custom-property-prefix: 'cds';
- Group: @carbon/type
- Used by:
Source code
@mixin custom-properties() {
@each $property, $value in $value {
#{$property}: var(
--#{$custom-property-prefix}-#{$name}-#{$property},
#{$value}
);
}
}
- Group: @carbon/type
- Requires:
- Used by:
Helper mixin to include the styles for a given token in any selector in your project. Also includes an optional fluid option that will enable fluid styles for the token if they are defined. Fluid styles will cause the token's font-size to be computed based on the viewport size. As a result, use with caution in fixed contexts.
Source code
@mixin carbon--type-style(
$name,
$fluid: false,
$breakpoints: $carbon--grid-breakpoints
) {
@if not map-has-key($tokens, $name) {
@error 'Unable to find a token with the name: `#{$name}`';
}
$token: map-get($tokens, $name);
// If $fluid is set to true and the token has breakpoints defined for fluid
// styles, delegate to the fluid-type helper for the given token
@if $fluid == true and map-has-key($token, 'breakpoints') {
@include fluid-type($token, $breakpoints);
} @else {
@if global-variable-exists('feature-flags') and
map-get($feature-flags, 'enable-css-custom-properties')
{
@include custom-properties($name, $token);
} @else {
// Otherwise, we just include all the property declarations directly on the
// selector
@include properties(map-remove($token, 'breakpoints'));
}
}
}
- Parameters:
Name | Description | Type | Default value |
---|---|---|---|
$name |
The name of the token to get the styles for | String |
— |
$fluid |
Specify whether to include fluid styles for the | Boolean |
false |
$breakpoints |
Provide a custom breakpoint map to use | Map |
$carbon--grid-breakpoints |