@repobit/dex-system-design 0.25.12 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +204 -0
- package/README.md +131 -8
- package/package.json +96 -13
- package/schemas/component-manifest.json +3294 -405
- package/schemas/manifest-omissions.json +173 -0
- package/src/blog/src/breakpoints.js +6 -6
- package/src/blog/src/content/blog-atoms-showcase.js +1 -1
- package/src/blog/src/content/blog-page-layout.js +2 -2
- package/src/blog/src/lib/article-toc.js +7 -7
- package/src/blog/src/shell/blog-shell.js +1 -1
- package/src/blog/src/tokens/blog.js +2 -2
- package/src/blog/src/tokens/core.js +34 -35
- package/src/blog/src/tokens/legacy.js +0 -9
- package/src/blog/tokens/blog.js +2 -2
- package/src/blog/tokens/core.js +34 -35
- package/src/blog/tokens/legacy.js +0 -9
- package/src/blog/tokens.css +36 -46
- package/src/components/accordion/accordion-bg.css.js +83 -59
- package/src/components/accordion/accordion-bg.js +29 -10
- package/src/components/accordion/accordion-bg.stories.js +67 -67
- package/src/components/accordion/accordion-keyboard.js +80 -0
- package/src/components/accordion/accordion.css.js +142 -80
- package/src/components/accordion/accordion.js +37 -10
- package/src/components/accordion/accordion.stories.js +7 -7
- package/src/components/agent-endpoints/agent-endpoints.css.js +36 -39
- package/src/components/agent-endpoints/agent-endpoints.js +30 -20
- package/src/components/agent-endpoints/agent-endpoints.stories.js +1 -1
- package/src/components/ai-guardian-demo.stories.js +91 -91
- package/src/components/alert/alert.css.js +198 -0
- package/src/components/alert/alert.js +103 -0
- package/src/components/alert/alert.stories.js +206 -0
- package/src/components/anchor/anchor-nav.css.js +213 -101
- package/src/components/anchor/anchor-nav.js +26 -40
- package/src/components/anchor/anchor.stories.js +22 -12
- package/src/components/annotation/annotation.css.js +58 -0
- package/src/components/annotation/annotation.js +67 -0
- package/src/components/annotation/annotation.stories.js +63 -0
- package/src/components/architecture.stories.js +285 -0
- package/src/components/atoms.stories.js +342 -0
- package/src/components/avatar/avatar.css.js +67 -0
- package/src/components/avatar/avatar.js +42 -0
- package/src/components/avatar/avatar.stories.js +95 -0
- package/src/components/awards/awards-flex.css.js +209 -23
- package/src/components/awards/awards-flex.js +66 -7
- package/src/components/awards/awards-flex.stories.js +1 -1
- package/src/components/awards/{awards-light.stories.js → awards-summary.stories.js} +54 -64
- package/src/components/awards/awards.css.js +116 -58
- package/src/components/awards/awards.js +102 -28
- package/src/components/awards/awards.stories.js +1 -1
- package/src/components/back/back.css.js +51 -22
- package/src/components/back/back.js +28 -7
- package/src/components/back/back.stories.js +9 -3
- package/src/components/badge/badge.css.js +158 -46
- package/src/components/badge/badge.js +62 -74
- package/src/components/badge/badge.stories.js +176 -248
- package/src/components/bento-grid/bento-grid.css.js +21 -16
- package/src/components/bento-grid/bento-grid.js +16 -4
- package/src/components/bento-grid/bento-grid.stories.js +19 -18
- package/src/components/bento-grid/bento-item.css.js +52 -28
- package/src/components/bento-grid/bento-item.js +2 -2
- package/src/components/blockquote/blockquote.css.js +47 -0
- package/src/components/blockquote/blockquote.js +29 -0
- package/src/components/blockquote/blockquote.stories.js +62 -0
- package/src/components/breadcrumb/breadcrumb.css.js +92 -22
- package/src/components/breadcrumb/breadcrumb.js +56 -11
- package/src/components/button/button.css.js +531 -161
- package/src/components/button/button.js +206 -214
- package/src/components/button/button.stories.js +322 -174
- package/src/components/caption/caption.css.js +21 -0
- package/src/components/caption/caption.js +31 -0
- package/src/components/caption/caption.stories.js +62 -0
- package/src/components/card-features/card-features.css.js +14 -22
- package/src/components/card-features/card-features.js +68 -9
- package/src/components/card-features/card-features.stories.js +11 -11
- package/src/components/cards/card.css.js +60 -81
- package/src/components/cards/card.js +56 -25
- package/src/components/cards/card.stories.js +39 -39
- package/src/components/carousel/carousel.css.js +93 -99
- package/src/components/carousel/carousel.js +32 -4
- package/src/components/checkbox/checkbox.css.js +111 -93
- package/src/components/checkbox/checkbox.js +64 -90
- package/src/components/checkbox/checkbox.stories.js +96 -29
- package/src/components/code/code.css.js +70 -0
- package/src/components/code/code.js +40 -0
- package/src/components/code/code.stories.js +73 -0
- package/src/components/compare/compare.css.js +179 -43
- package/src/components/compare/compare.js +52 -25
- package/src/components/compare/compare.stories.js +61 -4
- package/src/components/comparison-panel/comparison-panel.css.js +38 -51
- package/src/components/comparison-panel/comparison-panel.js +5 -4
- package/src/components/comparison-panel/comparison-panel.stories.js +1 -1
- package/src/components/compatibility-table/compatibility-table.css.js +180 -80
- package/src/components/compatibility-table/compatibility-table.js +37 -9
- package/src/components/control-alignment.stories.js +393 -0
- package/src/components/cta-banner/cta-banner.css.js +41 -13
- package/src/components/cta-banner/cta-banner.js +6 -5
- package/src/components/cta-banner/cta-banner.stories.js +43 -98
- package/src/components/display/display.css.js +25 -1
- package/src/components/display/display.js +46 -13
- package/src/components/display/display.stories.js +270 -40
- package/src/components/divider/divider-horizontal.js +21 -5
- package/src/components/divider/divider-vertical.js +15 -7
- package/src/components/divider/divider.css.js +2 -2
- package/src/components/divider/divider.stories.js +38 -34
- package/src/components/dropdown/dropdown.css.js +93 -126
- package/src/components/dropdown/dropdown.js +114 -34
- package/src/components/dropdown/dropdown.stories.js +56 -24
- package/src/components/features/features.css.js +24 -11
- package/src/components/features/features.js +7 -3
- package/src/components/features/features.stories.js +37 -37
- package/src/components/features-tab/features-tab.css.js +19 -8
- package/src/components/features-tab/features-tab.js +6 -5
- package/src/components/features-tab/features-tab.stories.js +23 -23
- package/src/components/fieldset/fieldset.css.js +30 -0
- package/src/components/fieldset/fieldset.js +28 -0
- package/src/components/fieldset/fieldset.stories.js +84 -0
- package/src/components/footer/footer-links-group.css.js +10 -14
- package/src/components/footer/footer-links-group.js +4 -3
- package/src/components/footer/footer-lp.css.js +59 -30
- package/src/components/footer/footer-lp.js +17 -12
- package/src/components/footer/footer-lp.stories.js +63 -75
- package/src/components/footer/footer-nav-menu.css.js +26 -4
- package/src/components/footer/footer-nav-menu.js +3 -2
- package/src/components/footer/footer.css.js +146 -264
- package/src/components/footer/footer.js +176 -106
- package/src/components/footer/footer.stories.js +9 -9
- package/src/components/footer/localeMap.js +1 -1
- package/src/components/grid/grid.css.js +1 -1
- package/src/components/grid/grid.js +49 -7
- package/src/components/grid/grid.stories.js +111 -0
- package/src/components/header/header-code.css.js +61 -51
- package/src/components/header/header-code.js +28 -14
- package/src/components/header/header-code.stories.js +5 -5
- package/src/components/header/header.css.js +655 -176
- package/src/components/header/header.js +269 -36
- package/src/components/header/header.stories.js +841 -18
- package/src/components/heading/heading.css.js +14 -17
- package/src/components/heading/heading.js +48 -33
- package/src/components/heading/heading.stories.js +27 -25
- package/src/components/help-text/help-text.css.js +21 -0
- package/src/components/help-text/help-text.js +25 -0
- package/src/components/help-text/help-text.stories.js +66 -0
- package/src/components/highlight/highlight.css.js +86 -64
- package/src/components/highlight/highlight.js +18 -27
- package/src/components/highlight/highlight.stories.js +14 -3
- package/src/components/icons/analysis-icon.js +6 -16
- package/src/components/icons/arrow-down-icon.js +6 -19
- package/src/components/icons/arrow-icon.js +44 -0
- package/src/components/icons/arrow-right-icon.js +30 -23
- package/src/components/icons/arrow-up-icon.js +19 -18
- package/src/components/icons/bd-ai-icon.js +1 -1
- package/src/components/icons/brand-marks.stories.js +279 -0
- package/src/components/icons/brand-signature-icon.js +42 -0
- package/src/components/icons/check-icon.js +27 -0
- package/src/components/icons/circle-info-icon.js +33 -0
- package/src/components/icons/close-icon.js +6 -18
- package/src/components/icons/family-icon.js +8 -20
- package/src/components/icons/globe-icon.js +6 -18
- package/src/components/icons/guide-icon.js +6 -18
- package/src/components/icons/icon-element.js +99 -0
- package/src/components/icons/icons.js +36 -0
- package/src/components/icons/icons.stories.js +184 -52
- package/src/components/icons/individual-icon.js +6 -18
- package/src/components/icons/laurel-icon.js +9 -19
- package/src/components/icons/machine-learning-icon.js +6 -17
- package/src/components/icons/marks.js +41 -0
- package/src/components/icons/minus-icon.js +7 -21
- package/src/components/icons/missing-icon.js +52 -0
- package/src/components/icons/plus-icon.js +7 -21
- package/src/components/icons/quote-icon.js +19 -19
- package/src/components/image/image.css.js +72 -25
- package/src/components/image/image.js +11 -6
- package/src/components/image/image.stories.js +2 -2
- package/src/components/input/custom-form.stories.js +214 -62
- package/src/components/input/input-clipboard.css.js +51 -144
- package/src/components/input/input-clipboard.js +31 -15
- package/src/components/input/input.css.js +8 -146
- package/src/components/input/input.js +93 -38
- package/src/components/install-options/install-options.css.js +84 -77
- package/src/components/install-options/install-options.js +33 -30
- package/src/components/install-options/install-options.stories.js +3 -3
- package/src/components/label/label.css.js +35 -0
- package/src/components/label/label.js +38 -0
- package/src/components/label/label.stories.js +82 -0
- package/src/components/light-carousel/light-carousel.css.js +111 -63
- package/src/components/light-carousel/light-carousel.js +85 -11
- package/src/components/light-carousel/light-carousel.stories.js +126 -82
- package/src/components/link/link.css.js +150 -99
- package/src/components/link/link.js +86 -11
- package/src/components/link/link.stories.js +124 -30
- package/src/components/list/list-item/list-item.css.js +74 -22
- package/src/components/list/list-item/list-item.js +32 -10
- package/src/components/list/list-item/list-item.stories.js +23 -23
- package/src/components/list/list.css.js +8 -2
- package/src/components/list/list.js +3 -2
- package/src/components/list/list.stories.js +222 -0
- package/src/components/modal/modal.css.js +114 -24
- package/src/components/modal/modal.js +83 -7
- package/src/components/modal/modal.stories.js +9 -9
- package/src/components/overview/overview.css.js +19 -14
- package/src/components/overview/overview.js +6 -5
- package/src/components/overview/overview.stories.js +10 -10
- package/src/components/page-switcher/page-switcher.css.js +97 -40
- package/src/components/page-switcher/page-switcher.js +28 -5
- package/src/components/page-switcher/page-switcher.stories.js +95 -0
- package/src/components/paragraph/paragraph.css.js +15 -10
- package/src/components/paragraph/paragraph.js +41 -44
- package/src/components/paragraph/paragraph.stories.js +56 -21
- package/src/components/picture/picture.css.js +103 -44
- package/src/components/picture/picture.js +100 -30
- package/src/components/picture/picture.stories.js +1 -1
- package/src/components/pricing-cards/new-pricing-card.js +3 -3
- package/src/components/pricing-cards/new-pricing.css.js +24 -15
- package/src/components/pricing-cards/pricing-card-actions.css.js +1 -1
- package/src/components/pricing-cards/pricing-card-actions.js +3 -4
- package/src/components/pricing-cards/pricing-card-container.css.js +3 -3
- package/src/components/pricing-cards/pricing-card-container.js +3 -2
- package/src/components/pricing-cards/pricing-card-header.css.js +10 -8
- package/src/components/pricing-cards/pricing-card-header.js +6 -7
- package/src/components/pricing-cards/pricing-card-pricing.css.js +16 -9
- package/src/components/pricing-cards/pricing-card-pricing.js +8 -6
- package/src/components/pricing-cards/pricing-card-show-more.css.js +11 -3
- package/src/components/pricing-cards/pricing-card-show-more.js +8 -3
- package/src/components/pricing-cards/pricing-card.css.js +244 -190
- package/src/components/pricing-cards/pricing-card.js +54 -70
- package/src/components/pricing-cards/pricing-feature-item.css.js +25 -8
- package/src/components/pricing-cards/pricing-feature-item.js +8 -3
- package/src/components/process-steps/process-steps.css.js +26 -14
- package/src/components/process-steps/process-steps.js +23 -6
- package/src/components/process-steps/process-steps.stories.js +1 -1
- package/src/components/progress/progress.css.js +80 -0
- package/src/components/progress/progress.js +42 -0
- package/src/components/progress/progress.stories.js +79 -0
- package/src/components/quick-answer/quick-answer.css.js +75 -13
- package/src/components/quick-answer/quick-answer.js +8 -3
- package/src/components/radio/radio.css.js +92 -128
- package/src/components/radio/radio.js +106 -127
- package/src/components/radio/radio.stories.js +54 -19
- package/src/components/review/review-grid.css.js +5 -6
- package/src/components/review/review-grid.js +14 -11
- package/src/components/review/review.css.js +11 -6
- package/src/components/review/review.js +3 -8
- package/src/components/shared/ensemble.css.js +93 -0
- package/src/components/shared/form-field.css.js +206 -0
- package/src/components/shared/prop-vocabulary.js +48 -0
- package/src/components/shared/token-scales.js +306 -0
- package/src/components/skeleton/skeleton.css.js +34 -0
- package/src/components/skeleton/skeleton.js +32 -0
- package/src/components/skeleton/skeleton.stories.js +70 -0
- package/src/components/spinner/spinner.css.js +62 -0
- package/src/components/spinner/spinner.js +38 -0
- package/src/components/spinner/spinner.stories.js +92 -0
- package/src/components/spotlight-section/spotlight-section.css.js +14 -13
- package/src/components/spotlight-section/spotlight-section.js +42 -39
- package/src/components/switch/switch.css.js +103 -0
- package/src/components/switch/switch.js +44 -0
- package/src/components/switch/switch.stories.js +86 -0
- package/src/components/tab-list/content-switcher.stories.js +189 -0
- package/src/components/tab-list/tab-list.css.js +250 -0
- package/src/components/tab-list/tab-list.js +184 -0
- package/src/components/tab-list/tab-list.stories.js +221 -0
- package/src/components/tabs/tabs.css.js +14 -123
- package/src/components/tabs/tabs.js +16 -19
- package/src/components/tabs/tabs.stories.js +95 -95
- package/src/components/tag/tag.css.js +54 -0
- package/src/components/tag/tag.js +32 -0
- package/src/components/tag/tag.stories.js +126 -0
- package/src/components/terminal/terminal-message.css.js +164 -60
- package/src/components/terminal/terminal-message.js +5 -5
- package/src/components/terminal/terminal-message.stories.js +70 -1
- package/src/components/termsOfUse/terms.css.js +25 -20
- package/src/components/termsOfUse/terms.js +13 -9
- package/src/components/termsOfUse/terms.stories.js +1 -1
- package/src/components/textarea/textarea.css.js +51 -0
- package/src/components/textarea/textarea.js +136 -0
- package/src/components/textarea/textarea.stories.js +191 -0
- package/src/components/tooltip/tooltip.css.js +75 -0
- package/src/components/tooltip/tooltip.js +156 -0
- package/src/components/tooltip/tooltip.stories.js +161 -0
- package/src/components/trust-panel/trust-panel.css.js +85 -33
- package/src/components/trust-panel/trust-panel.js +18 -10
- package/src/components/trust-panel/trust-panel.stories.js +1 -1
- package/src/components/ultimate-security-demo.stories.js +431 -0
- package/src/components/video/video.css.js +17 -0
- package/src/components/video/video.js +40 -0
- package/src/components/video/video.stories.js +106 -0
- package/src/components/video-player/video-player.css.js +67 -11
- package/src/components/video-player/video-player.js +35 -4
- package/src/components/video-player/video-player.stories.js +1 -1
- package/src/components/visual-alignment.stories.js +411 -0
- package/src/components/visually-hidden/visually-hidden.css.js +24 -0
- package/src/components/visually-hidden/visually-hidden.js +16 -0
- package/src/components/visually-hidden/visually-hidden.stories.js +56 -0
- package/src/stories/Button.stories.js +17 -17
- package/src/stories/Header.stories.js +10 -10
- package/src/stories/Page.js +1 -1
- package/src/stories/Page.stories.js +6 -6
- package/src/tokens/borders.stories.js +339 -0
- package/src/tokens/color-responsibilities.stories.js +227 -0
- package/src/tokens/dark-derivation.js +309 -0
- package/src/tokens/dark-findings.js +197 -0
- package/src/tokens/dark-mode.stories.js +207 -0
- package/src/tokens/dimension.stories.js +251 -0
- package/src/tokens/elevation.stories.js +143 -0
- package/src/tokens/focus.stories.js +276 -0
- package/src/tokens/fonts.css +20 -20
- package/src/tokens/fonts.stories.js +354 -374
- package/src/tokens/layout.css +25 -11
- package/src/tokens/motion.stories.js +231 -0
- package/src/tokens/shape.stories.js +272 -0
- package/src/tokens/spacing-rhythm.stories.js +359 -0
- package/src/tokens/spacing.stories.js +208 -703
- package/src/tokens/story-chrome.js +503 -0
- package/src/tokens/surfaces.stories.js +224 -0
- package/src/tokens/text-on-surface.stories.js +164 -0
- package/src/tokens/token-map.js +220 -0
- package/src/tokens/token-map.stories.js +257 -0
- package/src/tokens/token-purposes.js +266 -0
- package/src/tokens/tokens-grid.stories.js +388 -900
- package/src/tokens/tokens.css +1633 -1045
- package/src/tokens/tokens.js +1130 -492
- package/src/tokens/tokens.stories.js +137 -47
- package/src/tokens/type-ceiling-words.js +299 -0
- package/src/tokens/typography.stories.js +1003 -965
- package/src/tokens/vertical-rhythm.stories.js +224 -0
- package/src/components/awards/awards-icon.js +0 -56
- package/src/components/awards/awards-light.js +0 -240
- package/src/components/banner/banner.js +0 -60
- package/src/components/banner/banner.stories.js +0 -51
- package/src/components/button/icons.js +0 -24
- package/src/components/input/index.js +0 -0
- package/src/components/light-carousel/light-carousel-simple.css.js +0 -183
- package/src/components/light-carousel/light-carousel-simple.js +0 -74
- package/src/tokens/colors.js +0 -121
- package/src/tokens/typography.css.js +0 -207
- package/src/tokens/typography.js +0 -0
|
@@ -1,400 +1,380 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
|
+
import {
|
|
3
|
+
copyToken,
|
|
4
|
+
discoverConsumers,
|
|
5
|
+
discoverTokens,
|
|
6
|
+
docsPage,
|
|
7
|
+
readAllCssText,
|
|
8
|
+
refSection,
|
|
9
|
+
resolve,
|
|
10
|
+
usageCell
|
|
11
|
+
} from './story-chrome.js';
|
|
2
12
|
|
|
3
13
|
export default {
|
|
4
|
-
title: '
|
|
5
|
-
tags : ['autodocs']
|
|
6
|
-
|
|
7
|
-
argTypes: {
|
|
8
|
-
sampleText: {
|
|
9
|
-
control : 'text',
|
|
10
|
-
description: 'Text sample to display',
|
|
11
|
-
table : {
|
|
12
|
-
type : { summary: 'string' },
|
|
13
|
-
defaultValue: { summary: 'The quick brown fox jumps over the lazy dog.' }
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
fontSize: {
|
|
17
|
-
control : { type: 'select' },
|
|
18
|
-
options : ['small', 'medium', 'large', 'xlarge'],
|
|
19
|
-
description: 'Font size demonstration',
|
|
20
|
-
table : {
|
|
21
|
-
type : { summary: 'string' },
|
|
22
|
-
defaultValue: { summary: 'medium' }
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
parameters: {
|
|
28
|
-
docs: {
|
|
29
|
-
description: {
|
|
30
|
-
component: `
|
|
31
|
-
# Font Tokens & Typography System
|
|
32
|
-
|
|
33
|
-
Design tokens and typography system using IBM Plex font family.
|
|
34
|
-
|
|
35
|
-
## Overview
|
|
36
|
-
|
|
37
|
-
This system uses IBM Plex as the primary font family with CSS custom properties for consistent typography across the application.
|
|
38
|
-
|
|
39
|
-
## Font Families
|
|
40
|
-
|
|
41
|
-
### IBM Plex Sans
|
|
42
|
-
Primary font for UI text, headings, and body content.
|
|
43
|
-
|
|
44
|
-
**CSS Custom Property:** \`--font-family-sans\`
|
|
45
|
-
|
|
46
|
-
### IBM Plex Mono
|
|
47
|
-
Monospaced font for code, technical content, and data display.
|
|
48
|
-
|
|
49
|
-
**CSS Custom Property:** \`--font-family-mono\`
|
|
50
|
-
|
|
51
|
-
## Usage
|
|
52
|
-
|
|
53
|
-
### In CSS
|
|
54
|
-
\`\`\`css
|
|
55
|
-
/* Using CSS custom properties */
|
|
56
|
-
.element {
|
|
57
|
-
font-family: var(--font-family-sans);
|
|
58
|
-
font-weight: 600;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.code-block {
|
|
62
|
-
font-family: var(--font-family-mono);
|
|
63
|
-
font-size: 0.875rem;
|
|
64
|
-
}
|
|
65
|
-
\`\`\`
|
|
66
|
-
|
|
67
|
-
### In HTML with Classes
|
|
68
|
-
\`\`\`html
|
|
69
|
-
<div class="sans-normal">Regular text</div>
|
|
70
|
-
<div class="sans-semibold">Semi-bold text</div>
|
|
71
|
-
<div class="mono-regular">Code example</div>
|
|
72
|
-
\`\`\`
|
|
73
|
-
|
|
74
|
-
## Available Weights & Styles
|
|
75
|
-
|
|
76
|
-
### IBM Plex Sans
|
|
77
|
-
| Class | Weight | Style | Use Case |
|
|
78
|
-
|-------|--------|-------|----------|
|
|
79
|
-
| \`.sans-normal\` | 400 | Normal | Body text, paragraphs |
|
|
80
|
-
| \`.sans-semibold\` | 600 | Normal | Subheadings, emphasis |
|
|
81
|
-
| \`.sans-bold\` | 700 | Normal | Headings, titles |
|
|
82
|
-
| \`.sans-italic\` | 400 | Italic | Quotes, highlights |
|
|
83
|
-
|
|
84
|
-
### IBM Plex Mono
|
|
85
|
-
| Class | Weight | Style | Use Case |
|
|
86
|
-
|-------|--------|-------|----------|
|
|
87
|
-
| \`.mono-regular\` | 400 | Normal | Code snippets, technical text |
|
|
88
|
-
| \`.mono-bold\` | 700 | Normal | Important code, errors |
|
|
89
|
-
| \`.mono-italic\` | 400 | Italic | Comments, annotations |
|
|
90
|
-
|
|
91
|
-
## CSS Custom Properties
|
|
92
|
-
|
|
93
|
-
\`\`\`css
|
|
94
|
-
:root {
|
|
95
|
-
/* Font families */
|
|
96
|
-
--font-family-sans: 'IBM Plex Sans', Arial, sans-serif;
|
|
97
|
-
--font-family-mono: 'IBM Plex Mono', monospace;
|
|
98
|
-
|
|
99
|
-
/* Font sizes */
|
|
100
|
-
--font-size-xs: 0.75rem; /* 12px */
|
|
101
|
-
--font-size-sm: 0.875rem; /* 14px */
|
|
102
|
-
--font-size-md: 1rem; /* 16px */
|
|
103
|
-
--font-size-lg: 1.125rem; /* 18px */
|
|
104
|
-
--font-size-xl: 1.25rem; /* 20px */
|
|
105
|
-
--font-size-2xl: 1.5rem; /* 24px */
|
|
106
|
-
--font-size-3xl: 1.875rem; /* 30px */
|
|
107
|
-
--font-size-4xl: 2.25rem; /* 36px */
|
|
108
|
-
|
|
109
|
-
/* Line heights */
|
|
110
|
-
--line-height-tight: 1.25;
|
|
111
|
-
--line-height-normal: 1.5;
|
|
112
|
-
--line-height-relaxed: 1.75;
|
|
113
|
-
}
|
|
114
|
-
\`\`\`
|
|
115
|
-
|
|
116
|
-
## Best Practices
|
|
117
|
-
|
|
118
|
-
1. **Use semantic HTML**: Always use proper heading tags (h1-h6) for structure
|
|
119
|
-
2. **Respect hierarchy**: Maintain consistent font size hierarchy
|
|
120
|
-
3. **Contrast ratio**: Ensure minimum 4.5:1 contrast for normal text
|
|
121
|
-
4. **Line length**: Keep line length between 50-75 characters for readability
|
|
122
|
-
5. **Responsive**: Use relative units (rem, em) for font sizes
|
|
123
|
-
|
|
124
|
-
## Browser Support
|
|
125
|
-
|
|
126
|
-
IBM Plex is supported in all modern browsers:
|
|
127
|
-
- Chrome 60+
|
|
128
|
-
- Firefox 55+
|
|
129
|
-
- Safari 11+
|
|
130
|
-
- Edge 79+
|
|
131
|
-
|
|
132
|
-
## Loading Fonts
|
|
133
|
-
|
|
134
|
-
Fonts are loaded via \`@font-face\` declarations in the global styles:
|
|
135
|
-
|
|
136
|
-
\`\`\`css
|
|
137
|
-
@font-face {
|
|
138
|
-
font-family: 'IBM Plex Sans';
|
|
139
|
-
font-style: normal;
|
|
140
|
-
font-weight: 400;
|
|
141
|
-
src: url('/fonts/ibm-plex-sans-regular.woff2') format('woff2');
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
@font-face {
|
|
145
|
-
font-family: 'IBM Plex Sans';
|
|
146
|
-
font-style: italic;
|
|
147
|
-
font-weight: 400;
|
|
148
|
-
src: url('/fonts/ibm-plex-sans-italic.woff2') format('woff2');
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
@font-face {
|
|
152
|
-
font-family: 'IBM Plex Sans';
|
|
153
|
-
font-style: normal;
|
|
154
|
-
font-weight: 600;
|
|
155
|
-
src: url('/fonts/ibm-plex-sans-semibold.woff2') format('woff2');
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
@font-face {
|
|
159
|
-
font-family: 'IBM Plex Sans';
|
|
160
|
-
font-style: normal;
|
|
161
|
-
font-weight: 700;
|
|
162
|
-
src: url('/fonts/ibm-plex-sans-bold.woff2') format('woff2');
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
@font-face {
|
|
166
|
-
font-family: 'IBM Plex Mono';
|
|
167
|
-
font-style: normal;
|
|
168
|
-
font-weight: 400;
|
|
169
|
-
src: url('/fonts/ibm-plex-mono-regular.woff2') format('woff2');
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
@font-face {
|
|
173
|
-
font-family: 'IBM Plex Mono';
|
|
174
|
-
font-style: italic;
|
|
175
|
-
font-weight: 400;
|
|
176
|
-
src: url('/fonts/ibm-plex-mono-italic.woff2') format('woff2');
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
@font-face {
|
|
180
|
-
font-family: 'IBM Plex Mono';
|
|
181
|
-
font-style: normal;
|
|
182
|
-
font-weight: 700;
|
|
183
|
-
src: url('/fonts/ibm-plex-mono-bold.woff2') format('woff2');
|
|
184
|
-
}
|
|
185
|
-
\`\`\`
|
|
186
|
-
`
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
14
|
+
title: 'Foundations/Fonts',
|
|
15
|
+
tags : ['autodocs']
|
|
190
16
|
};
|
|
191
17
|
|
|
192
|
-
const
|
|
18
|
+
const fontStyles = html`
|
|
193
19
|
<style>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
border-radius: 8px;
|
|
199
|
-
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
200
|
-
}
|
|
201
|
-
h3 {
|
|
202
|
-
font-family: var(--font-family-sans, 'IBM Plex Sans', Arial, sans-serif);
|
|
203
|
-
font-weight: 600;
|
|
204
|
-
font-size: 1.2rem;
|
|
205
|
-
margin-bottom: 12px;
|
|
206
|
-
color: #333;
|
|
207
|
-
border-bottom: 2px solid #f0f0f0;
|
|
208
|
-
padding-bottom: 8px;
|
|
209
|
-
}
|
|
210
|
-
.sample {
|
|
211
|
-
margin-bottom: 12px;
|
|
212
|
-
font-size: 1.1rem;
|
|
213
|
-
line-height: 1.5;
|
|
214
|
-
padding: 8px;
|
|
215
|
-
background: #fafafa;
|
|
216
|
-
border-radius: 4px;
|
|
217
|
-
}
|
|
218
|
-
.sans-normal {
|
|
219
|
-
font-family: var(--font-family-sans, 'IBM Plex Sans', Arial, sans-serif);
|
|
220
|
-
font-weight: 400;
|
|
221
|
-
font-style: normal;
|
|
222
|
-
}
|
|
223
|
-
.sans-semibold {
|
|
224
|
-
font-family: var(--font-family-sans, 'IBM Plex Sans', Arial, sans-serif);
|
|
225
|
-
font-weight: 600;
|
|
226
|
-
font-style: normal;
|
|
20
|
+
.face-sample {
|
|
21
|
+
font-size: var(--typography-fontSize-lg);
|
|
22
|
+
color: var(--color-neutral-900);
|
|
23
|
+
white-space: nowrap;
|
|
227
24
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
font-
|
|
231
|
-
font-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
font-family: var(--font-family-sans, 'IBM Plex Sans', Arial, sans-serif);
|
|
235
|
-
font-weight: 400;
|
|
236
|
-
font-style: italic;
|
|
25
|
+
|
|
26
|
+
.file {
|
|
27
|
+
font-family: var(--typography-fontFamily-mono);
|
|
28
|
+
font-size: var(--typography-fontSize-xxs);
|
|
29
|
+
color: var(--color-neutral-500);
|
|
30
|
+
white-space: nowrap;
|
|
237
31
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
font-
|
|
241
|
-
font-
|
|
242
|
-
|
|
243
|
-
|
|
32
|
+
|
|
33
|
+
.status {
|
|
34
|
+
font-family: var(--typography-fontFamily-sans);
|
|
35
|
+
font-size: var(--typography-fontSize-xxs);
|
|
36
|
+
font-weight: var(--typography-fontWeight-semibold);
|
|
37
|
+
padding: 1px var(--spacing-6);
|
|
38
|
+
border-radius: var(--radius-sm);
|
|
244
39
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
background: #f5f5f5;
|
|
250
|
-
border-left: 3px solid #ddd;
|
|
40
|
+
|
|
41
|
+
.status[data-ok='true'] {
|
|
42
|
+
color: var(--color-green-800);
|
|
43
|
+
background: var(--color-green-50);
|
|
251
44
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
background: #f5f5f5;
|
|
257
|
-
border-left: 3px solid #ddd;
|
|
45
|
+
|
|
46
|
+
.status[data-ok='false'] {
|
|
47
|
+
color: var(--color-red-800);
|
|
48
|
+
background: var(--color-red-50);
|
|
258
49
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
margin-top: 4px;
|
|
264
|
-
padding-left: 12px;
|
|
50
|
+
|
|
51
|
+
.status[data-ok='pending'] {
|
|
52
|
+
color: var(--color-neutral-600);
|
|
53
|
+
background: var(--color-neutral-50);
|
|
265
54
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
padding:
|
|
270
|
-
|
|
271
|
-
font-
|
|
272
|
-
|
|
273
|
-
|
|
55
|
+
|
|
56
|
+
.stack-list {
|
|
57
|
+
margin: 0;
|
|
58
|
+
padding-left: var(--spacing-16);
|
|
59
|
+
font-family: var(--typography-fontFamily-mono);
|
|
60
|
+
font-size: var(--typography-fontSize-xxs);
|
|
61
|
+
color: var(--color-neutral-600);
|
|
62
|
+
line-height: var(--typography-lineHeight-normal);
|
|
274
63
|
}
|
|
275
|
-
|
|
276
|
-
|
|
64
|
+
|
|
65
|
+
.pangram {
|
|
66
|
+
margin: 0 0 var(--spacing-12);
|
|
67
|
+
color: var(--color-neutral-900);
|
|
277
68
|
}
|
|
278
|
-
|
|
279
|
-
|
|
69
|
+
|
|
70
|
+
.pangram:last-child {
|
|
71
|
+
margin-bottom: 0;
|
|
280
72
|
}
|
|
281
73
|
</style>
|
|
74
|
+
`;
|
|
282
75
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Reads the @font-face rules actually registered in the document. These only
|
|
78
|
+
* exist because fonts.css is loaded in document scope — @font-face inside a
|
|
79
|
+
* shadow root never reaches the document font set.
|
|
80
|
+
*/
|
|
81
|
+
function readFontFaces(ownFamilies) {
|
|
82
|
+
const faces = [];
|
|
83
|
+
for (const sheet of Array.from(document.styleSheets)) {
|
|
84
|
+
let rules;
|
|
85
|
+
try {
|
|
86
|
+
rules = sheet.cssRules;
|
|
87
|
+
} catch {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
for (const rule of Array.from(rules)) {
|
|
91
|
+
if (rule.constructor.name !== 'CSSFontFaceRule' && !(rule.style && rule.type === 5)) continue;
|
|
92
|
+
const family = (rule.style.getPropertyValue('font-family') || '').replace(/['"]/g, '').trim();
|
|
93
|
+
// Storybook registers its own UI faces in this document; only report the
|
|
94
|
+
// families our own --typography-fontFamily-* tokens actually ask for.
|
|
95
|
+
if (!family || !ownFamilies.has(family)) continue;
|
|
96
|
+
faces.push({
|
|
97
|
+
family,
|
|
98
|
+
weight : (rule.style.getPropertyValue('font-weight') || '400').trim(),
|
|
99
|
+
style : (rule.style.getPropertyValue('font-style') || 'normal').trim(),
|
|
100
|
+
display: (rule.style.getPropertyValue('font-display') || '—').trim(),
|
|
101
|
+
file : ((rule.style.getPropertyValue('src') || '').match(/([^/'")]+\.woff2?)/) || [null, '—'])[1]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return faces;
|
|
106
|
+
}
|
|
302
107
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
<div class="
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
108
|
+
function faceTable(family, faces) {
|
|
109
|
+
const sorted = [...faces].sort(
|
|
110
|
+
(a, b) => Number(a.weight) - Number(b.weight) || a.style.localeCompare(b.style)
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
return html`
|
|
114
|
+
<div class="table-scroll">
|
|
115
|
+
<table>
|
|
116
|
+
<caption>${family} faces</caption>
|
|
117
|
+
<thead>
|
|
118
|
+
<tr>
|
|
119
|
+
<th scope="col">Weight</th>
|
|
120
|
+
<th scope="col">Style</th>
|
|
121
|
+
<th scope="col">Sample</th>
|
|
122
|
+
<th scope="col">File</th>
|
|
123
|
+
<th scope="col">font-display</th>
|
|
124
|
+
<th scope="col">Loaded</th>
|
|
125
|
+
</tr>
|
|
126
|
+
</thead>
|
|
127
|
+
<tbody>
|
|
128
|
+
${sorted.map(face => {
|
|
129
|
+
const spec = `${face.style} ${face.weight} 16px "${family}"`;
|
|
130
|
+
const id = `${family}|${face.weight}|${face.style}`;
|
|
131
|
+
// Faces are fetched lazily, so check() alone only reports what the
|
|
132
|
+
// page happens to have used. Ask for the face, then report whether
|
|
133
|
+
// the file actually resolved.
|
|
134
|
+
queueMicrotask(async () => {
|
|
135
|
+
let ok;
|
|
136
|
+
try {
|
|
137
|
+
const loadedFaces = await document.fonts.load(spec);
|
|
138
|
+
ok = loadedFaces.length > 0;
|
|
139
|
+
} catch {
|
|
140
|
+
ok = false;
|
|
141
|
+
}
|
|
142
|
+
for (const node of document.querySelectorAll(`[data-face="${id}"]`)) {
|
|
143
|
+
node.dataset.ok = String(ok);
|
|
144
|
+
node.textContent = ok ? 'yes' : 'failed';
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
return html`
|
|
148
|
+
<tr>
|
|
149
|
+
<td class="num">${face.weight}</td>
|
|
150
|
+
<td class="mono muted">${face.style}</td>
|
|
151
|
+
<td
|
|
152
|
+
class="face-sample"
|
|
153
|
+
style="font-family: '${family}'; font-weight: ${face.weight}; font-style: ${face.style}"
|
|
154
|
+
>
|
|
155
|
+
Handgloves 123
|
|
156
|
+
</td>
|
|
157
|
+
<td class="file">${face.file}</td>
|
|
158
|
+
<td class="mono muted">${face.display}</td>
|
|
159
|
+
<td>
|
|
160
|
+
<span class="status" data-face=${id} data-ok="pending">checking</span>
|
|
161
|
+
</td>
|
|
162
|
+
</tr>
|
|
163
|
+
`;
|
|
164
|
+
})}
|
|
165
|
+
</tbody>
|
|
166
|
+
</table>
|
|
316
167
|
</div>
|
|
317
|
-
|
|
168
|
+
`;
|
|
169
|
+
}
|
|
318
170
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
171
|
+
export const Default = () => {
|
|
172
|
+
const cssText = readAllCssText();
|
|
173
|
+
const consumers = discoverConsumers(cssText);
|
|
174
|
+
|
|
175
|
+
const familyTokenNames = discoverTokens(
|
|
176
|
+
cssText,
|
|
177
|
+
/(--typography-fontFamily-[a-zA-Z0-9-]+)\s*:/g
|
|
178
|
+
).map(match => match[1]);
|
|
179
|
+
|
|
180
|
+
// the first entry of each stack is the face we actually ship
|
|
181
|
+
const ownFamilies = new Set(
|
|
182
|
+
familyTokenNames
|
|
183
|
+
.map(token => resolve(token).split(',')[0].replace(/['"]/g, '').trim())
|
|
184
|
+
.filter(Boolean)
|
|
185
|
+
);
|
|
186
|
+
const faces = readFontFaces(ownFamilies);
|
|
187
|
+
|
|
188
|
+
const byFamily = new Map();
|
|
189
|
+
for (const face of faces) {
|
|
190
|
+
if (!byFamily.has(face.family)) byFamily.set(face.family, []);
|
|
191
|
+
byFamily.get(face.family).push(face);
|
|
192
|
+
}
|
|
335
193
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
194
|
+
const familyTokens = familyTokenNames;
|
|
195
|
+
|
|
196
|
+
return html`
|
|
197
|
+
${fontStyles}
|
|
198
|
+
${docsPage({
|
|
199
|
+
title: 'Fonts',
|
|
200
|
+
lede : html`The families the design system ships, and the individual faces registered in the
|
|
201
|
+
document. Both tables are read from the loaded CSS at render time.`,
|
|
202
|
+
note: html`Faces are registered by <code>src/tokens/fonts.css</code>, which must be loaded
|
|
203
|
+
in <b>document scope</b>. An <code>@font-face</code> rule inside a component's shadow root
|
|
204
|
+
never reaches <code>document.fonts</code>, so it silently does nothing.
|
|
205
|
+
<b>Loaded</b> asks the browser to fetch each face and reports whether the file actually
|
|
206
|
+
resolved, so a broken <code>url()</code> shows up here as <b>failed</b>.`,
|
|
207
|
+
children: html`
|
|
208
|
+
${refSection({
|
|
209
|
+
name : 'Family tokens',
|
|
210
|
+
meta : `${familyTokens.length} tokens · --typography-fontFamily-*`,
|
|
211
|
+
children: html`
|
|
212
|
+
<div class="table-scroll">
|
|
213
|
+
<table>
|
|
214
|
+
<caption>Font family tokens</caption>
|
|
215
|
+
<thead>
|
|
216
|
+
<tr>
|
|
217
|
+
<th scope="col">Token</th>
|
|
218
|
+
<th scope="col">Sample</th>
|
|
219
|
+
<th scope="col">Stack</th>
|
|
220
|
+
<th scope="col">Used by</th>
|
|
221
|
+
</tr>
|
|
222
|
+
</thead>
|
|
223
|
+
<tbody>
|
|
224
|
+
${familyTokens.map(token => {
|
|
225
|
+
const stack = resolve(token)
|
|
226
|
+
.split(',')
|
|
227
|
+
.map(part => part.trim())
|
|
228
|
+
.filter(Boolean);
|
|
229
|
+
return html`
|
|
230
|
+
<tr>
|
|
231
|
+
<td>${copyToken(token)}</td>
|
|
232
|
+
<td class="face-sample" style="font-family: var(${token})">
|
|
233
|
+
Handgloves 123
|
|
234
|
+
</td>
|
|
235
|
+
<td>
|
|
236
|
+
<ol class="stack-list">
|
|
237
|
+
${stack.map(part => html`<li>${part}</li>`)}
|
|
238
|
+
</ol>
|
|
239
|
+
</td>
|
|
240
|
+
<td>${usageCell(consumers.get(token))}</td>
|
|
241
|
+
</tr>
|
|
242
|
+
`;
|
|
243
|
+
})}
|
|
244
|
+
</tbody>
|
|
245
|
+
</table>
|
|
246
|
+
</div>
|
|
247
|
+
`
|
|
248
|
+
})}
|
|
249
|
+
${[...byFamily].map(([family, list]) =>
|
|
250
|
+
refSection({
|
|
251
|
+
name : family,
|
|
252
|
+
meta : `${list.length} faces registered`,
|
|
253
|
+
children: faceTable(family, list)
|
|
254
|
+
})
|
|
255
|
+
)}
|
|
256
|
+
${byFamily.size
|
|
257
|
+
? ''
|
|
258
|
+
: html`<div class="docs-note">
|
|
259
|
+
No <code>@font-face</code> rules found in the document. Check that
|
|
260
|
+
<code>src/tokens/fonts.css</code> is imported in
|
|
261
|
+
<code>.storybook/preview.js</code>.
|
|
262
|
+
</div>`}
|
|
263
|
+
`
|
|
264
|
+
})}
|
|
265
|
+
`;
|
|
340
266
|
};
|
|
341
267
|
|
|
342
|
-
export const CustomText =
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
268
|
+
export const CustomText = {
|
|
269
|
+
args: {
|
|
270
|
+
text: 'The quick brown fox jumps over the lazy dog'
|
|
271
|
+
},
|
|
272
|
+
argTypes: {
|
|
273
|
+
text: { control: 'text', name: 'Specimen text' }
|
|
274
|
+
},
|
|
275
|
+
render: ({ text }) => {
|
|
276
|
+
const weights = ['300', '400', '500', '600', '700'];
|
|
277
|
+
|
|
278
|
+
return html`
|
|
279
|
+
${fontStyles}
|
|
280
|
+
${docsPage({
|
|
281
|
+
title : 'Specimen',
|
|
282
|
+
lede : 'Set your own text to judge the families at every weight and in italic.',
|
|
283
|
+
children: ['--typography-fontFamily-sans', '--typography-fontFamily-mono'].map(token =>
|
|
284
|
+
refSection({
|
|
285
|
+
name : token.replace('--typography-fontFamily-', ''),
|
|
286
|
+
meta : token,
|
|
287
|
+
children: html`
|
|
288
|
+
<div class="specimen">
|
|
289
|
+
${weights.map(
|
|
290
|
+
weight => html`
|
|
291
|
+
<p
|
|
292
|
+
class="pangram"
|
|
293
|
+
style="font-family: var(${token}); font-weight: ${weight}; font-size: var(--typography-fontSize-lg)"
|
|
294
|
+
>
|
|
295
|
+
<span class="file">${weight}</span> ${text}
|
|
296
|
+
</p>
|
|
297
|
+
<p
|
|
298
|
+
class="pangram"
|
|
299
|
+
style="font-family: var(${token}); font-weight: ${weight}; font-style: italic; font-size: var(--typography-fontSize-lg)"
|
|
300
|
+
>
|
|
301
|
+
<span class="file">${weight} italic</span> ${text}
|
|
302
|
+
</p>
|
|
303
|
+
`
|
|
304
|
+
)}
|
|
305
|
+
</div>
|
|
306
|
+
`
|
|
307
|
+
})
|
|
308
|
+
)
|
|
309
|
+
})}
|
|
310
|
+
`;
|
|
311
|
+
}
|
|
346
312
|
};
|
|
347
313
|
|
|
348
314
|
export const TechnicalExample = () => html`
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
315
|
+
${fontStyles}
|
|
316
|
+
${docsPage({
|
|
317
|
+
title: 'Monospace in context',
|
|
318
|
+
lede : html`The mono family carries code and any tabular figures. It is applied through
|
|
319
|
+
<code>--typography-code-inline-*</code> and <code>--typography-code-block-*</code> rather
|
|
320
|
+
than by naming the family directly.`,
|
|
321
|
+
children: html`
|
|
322
|
+
${refSection({
|
|
323
|
+
name : 'Inline code',
|
|
324
|
+
meta : '--typography-code-inline-*',
|
|
325
|
+
children: html`
|
|
326
|
+
<div class="specimen">
|
|
327
|
+
<p style="font: var(--typography-body-regular-fontWeight) var(--typography-body-regular-fontSize)/var(--typography-body-regular-lineHeight) var(--typography-fontFamily-sans); margin: 0">
|
|
328
|
+
Apply a token with
|
|
329
|
+
<code
|
|
330
|
+
style="font-family: var(--typography-code-inline-fontFamily); font-size: var(--typography-code-inline-fontSize); background: var(--color-neutral-50); padding: 0 var(--spacing-4); border-radius: var(--radius-sm)"
|
|
331
|
+
>var(--color-blue-500)</code
|
|
332
|
+
>
|
|
333
|
+
rather than a raw hex value.
|
|
334
|
+
</p>
|
|
335
|
+
</div>
|
|
336
|
+
`
|
|
337
|
+
})}
|
|
338
|
+
${refSection({
|
|
339
|
+
name : 'Code block',
|
|
340
|
+
meta : '--typography-code-block-*',
|
|
341
|
+
children: html`
|
|
342
|
+
<div class="specimen">
|
|
343
|
+
<pre
|
|
344
|
+
style="font-family: var(--typography-code-block-fontFamily); font-size: var(--typography-code-block-fontSize); line-height: var(--typography-code-block-lineHeight); margin: 0; overflow-x: auto"
|
|
345
|
+
>
|
|
346
|
+
.button {
|
|
347
|
+
padding: var(--spacing-12) var(--spacing-20);
|
|
348
|
+
font-size: var(--typography-fontSize-base);
|
|
349
|
+
border-radius: var(--radius-md);
|
|
350
|
+
}</pre
|
|
351
|
+
>
|
|
352
|
+
</div>
|
|
353
|
+
`
|
|
354
|
+
})}
|
|
355
|
+
${refSection({
|
|
356
|
+
name : 'Tabular figures',
|
|
357
|
+
meta : 'font-variant-numeric: tabular-nums',
|
|
358
|
+
children: html`
|
|
359
|
+
<div class="specimen">
|
|
360
|
+
<table>
|
|
361
|
+
<caption>Tabular figures</caption>
|
|
362
|
+
<thead>
|
|
363
|
+
<tr>
|
|
364
|
+
<th scope="col">Plan</th>
|
|
365
|
+
<th scope="col">Devices</th>
|
|
366
|
+
<th scope="col">Price</th>
|
|
367
|
+
</tr>
|
|
368
|
+
</thead>
|
|
369
|
+
<tbody>
|
|
370
|
+
<tr><td>Antivirus Plus</td><td class="num">3</td><td class="num">29.99</td></tr>
|
|
371
|
+
<tr><td>Internet Security</td><td class="num">10</td><td class="num">104.99</td></tr>
|
|
372
|
+
<tr><td>Ultimate Security</td><td class="num">25</td><td class="num">1109.99</td></tr>
|
|
373
|
+
</tbody>
|
|
374
|
+
</table>
|
|
375
|
+
</div>
|
|
376
|
+
`
|
|
377
|
+
})}
|
|
378
|
+
`
|
|
379
|
+
})}
|
|
380
|
+
`;
|