forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web-components): create css partials for typography styles (micr…
…osoft#31164) Co-authored-by: Christopher Holt <=>
- Loading branch information
1 parent
0ac8d5f
commit 52f8b4b
Showing
4 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-web-components-6c28acc1-a99b-4101-a17a-54d88ec1a057.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "create CSS partials for named typography styles", | ||
"packageName": "@fluentui/web-components", | ||
"email": "13071055+chrisdholt@users.noreply.github.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
export * from './badge.partials.js'; | ||
export { | ||
typographyBody1Styles, | ||
typographyBody1StrongStyles, | ||
typographyBody1StrongerStyles, | ||
typographyBody2Styles, | ||
typographyCaption1StrongStyles, | ||
typographyCaption1StrongerStyles, | ||
typographyCaption1Styles, | ||
typographyCaption2StrongStyles, | ||
typographyCaption2Styles, | ||
typographyDisplayStyles, | ||
typographyLargeTitleStyles, | ||
typographySubtitle1Styles, | ||
typographySubtitle2StrongerStyles, | ||
typographySubtitle2Styles, | ||
typographyTitle1Styles, | ||
typographyTitle2Styles, | ||
typographyTitle3Styles, | ||
} from './typography.partials.js'; |
144 changes: 144 additions & 0 deletions
144
packages/web-components/src/styles/partials/typography.partials.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
import { css, CSSDirective } from '@microsoft/fast-element'; | ||
import { | ||
fontFamilyBase, | ||
fontSizeBase100, | ||
fontSizeBase200, | ||
fontSizeBase300, | ||
fontSizeBase400, | ||
fontSizeBase500, | ||
fontSizeBase600, | ||
fontSizeHero1000, | ||
fontSizeHero700, | ||
fontSizeHero800, | ||
fontSizeHero900, | ||
fontWeightBold, | ||
fontWeightRegular, | ||
fontWeightSemibold, | ||
lineHeightBase100, | ||
lineHeightBase200, | ||
lineHeightBase300, | ||
lineHeightBase400, | ||
lineHeightBase500, | ||
lineHeightBase600, | ||
lineHeightHero1000, | ||
lineHeightHero700, | ||
lineHeightHero800, | ||
lineHeightHero900, | ||
} from '../../theme/design-tokens.js'; | ||
|
||
export const typographyBody1Styles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase300}; | ||
line-height: ${lineHeightBase300}; | ||
font-weight: ${fontWeightRegular}; | ||
`; | ||
export const typographyBody1StrongStyles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase300}; | ||
line-height: ${lineHeightBase300}; | ||
font-weight: ${fontWeightSemibold}; | ||
`; | ||
|
||
export const typographyBody1StrongerStyles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase300}; | ||
line-height: ${lineHeightBase300}; | ||
font-weight: ${fontWeightBold}; | ||
`; | ||
|
||
export const typographyBody2Styles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase400}; | ||
line-height: ${lineHeightBase400}; | ||
font-weight: ${fontWeightRegular}; | ||
`; | ||
|
||
export const typographyCaption1Styles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase200}; | ||
line-height: ${lineHeightBase200}; | ||
font-weight: ${fontWeightRegular}; | ||
`; | ||
|
||
export const typographyCaption1StrongStyles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase200}; | ||
line-height: ${lineHeightBase200}; | ||
font-weight: ${fontWeightSemibold}; | ||
`; | ||
|
||
export const typographyCaption1StrongerStyles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase200}; | ||
line-height: ${lineHeightBase200}; | ||
font-weight: ${fontWeightBold}; | ||
`; | ||
export const typographyCaption2Styles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase100}; | ||
line-height: ${lineHeightBase100}; | ||
font-weight: ${fontWeightRegular}; | ||
`; | ||
|
||
export const typographyCaption2StrongStyles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase100}; | ||
line-height: ${lineHeightBase100}; | ||
font-weight: ${fontWeightSemibold}; | ||
`; | ||
|
||
export const typographySubtitle1Styles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase500}; | ||
line-height: ${lineHeightBase500}; | ||
font-weight: ${fontWeightSemibold}; | ||
`; | ||
|
||
export const typographySubtitle2Styles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase400}; | ||
line-height: ${lineHeightBase400}; | ||
font-weight: ${fontWeightSemibold}; | ||
`; | ||
|
||
export const typographySubtitle2StrongerStyles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase400}; | ||
line-height: ${lineHeightBase400}; | ||
font-weight: ${fontWeightBold}; | ||
`; | ||
|
||
export const typographyTitle1Styles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeHero800}; | ||
line-height: ${lineHeightHero800}; | ||
font-weight: ${fontWeightSemibold}; | ||
`; | ||
|
||
export const typographyTitle2Styles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeHero700}; | ||
line-height: ${lineHeightHero700}; | ||
font-weight: ${fontWeightSemibold}; | ||
`; | ||
|
||
export const typographyTitle3Styles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeBase600}; | ||
line-height: ${lineHeightBase600}; | ||
font-weight: ${fontWeightSemibold}; | ||
`; | ||
|
||
export const typographyLargeTitleStyles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeHero900}; | ||
line-height: ${lineHeightHero900}; | ||
font-weight: ${fontWeightSemibold}; | ||
`; | ||
|
||
export const typographyDisplayStyles: CSSDirective = css.partial` | ||
font-family: ${fontFamilyBase}; | ||
font-size: ${fontSizeHero1000}; | ||
line-height: ${lineHeightHero1000}; | ||
font-weight: ${fontWeightSemibold}; | ||
`; |