-
Notifications
You must be signed in to change notification settings - Fork 861
[Theme] Fix typography scss order #8922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,4 @@ | ||
| **Bug fixes** | ||
|
|
||
| - Updated shared theme SCSS imports to ensure expected results for the SCSS function `lineHeightFromBaseline` | ||
|
|
This file contains hidden or 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 hidden or 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,16 @@ | ||
| **Breaking changes** | ||
|
|
||
| - Removed obsolete SCSS typography definitions - use the definitions from the themes directly | ||
| - $euiFontFamily | ||
| - $euiTextScale | ||
| - $euiFontSize | ||
| - $euiFontSizeXS | ||
| - $euiFontSizeS | ||
| - $euiFontSizeM | ||
| - $euiFontSizeL | ||
| - $euiFontSizeXL | ||
| - $euiFontSizeXXL | ||
| - $euiBodyLineHeight | ||
weronikaolejniczak marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - $euiTitles | ||
| - convertToRem() | ||
| - lineHeightFromBaseline() | ||
69 changes: 1 addition & 68 deletions
69
packages/eui-theme-common/src/global_styling/variables/_typography.scss
This file contains hidden or 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,75 +1,8 @@ | ||
| // Families | ||
| $euiFontFamily: 'Inter', BlinkMacSystemFont, Helvetica, Arial, sans-serif !default; | ||
| $euiCodeFontFamily: 'Roboto Mono', Menlo, Courier, monospace !default; | ||
weronikaolejniczak marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Careful using ligatures. Code editors like ACE will often error because of width calculations | ||
| $euiFontFeatureSettings: 'calt' 1, 'kern' 1, 'liga' 1 !default; | ||
|
|
||
| // Font sizes -- scale is loosely based on Major Third (1.250) | ||
| $euiTextScale: 2.25, 1.75, 1.25, 1.125, 1, .875, .75 !default; | ||
|
|
||
| $euiFontSize: $euiSize !default; // 5th position in scale | ||
| $euiFontSizeXS: $euiFontSize * nth($euiTextScale, 7) !default; // 12px | ||
| $euiFontSizeS: $euiFontSize * nth($euiTextScale, 6) !default; // 14px | ||
| $euiFontSizeM: $euiFontSize * nth($euiTextScale, 4) !default; // 18px | ||
| $euiFontSizeL: $euiFontSize * nth($euiTextScale, 3) !default; // 20px | ||
| $euiFontSizeXL: $euiFontSize * nth($euiTextScale, 2) !default; // 28px | ||
| $euiFontSizeXXL: $euiFontSize * nth($euiTextScale, 1) !default; // 36px | ||
|
|
||
| // Line height | ||
| $euiLineHeight: 1.5 !default; | ||
| $euiBodyLineHeight: 1 !default; | ||
|
|
||
| // Normally functions are imported before variables in `_index.scss` files | ||
| // But because they need to consume some typography variables they need to live here | ||
| @function convertToRem($size) { | ||
| @return #{$size / $euiFontSize}rem; | ||
| } | ||
|
|
||
| // Our base gridline is at 1/2 the font-size, ensure line-heights stay on that gridline. | ||
| // EX: A proper line-height for text is 1.5 times the font-size. | ||
| // If our base font size (euiFontSize) is 16, our baseline is 8 (16*1.5 / 3). To ensure the | ||
| // text stays on the baseline, we pass a multiplier to calculate a line-height in rems. | ||
| @function lineHeightFromBaseline($multiplier: 3) { | ||
| @return convertToRem(($euiFontSize / 2) * $multiplier); | ||
| } | ||
|
|
||
| // Titles map | ||
| // Lists all the properties per EuiTitle size that then gets looped through to create the selectors. | ||
| // The map allows for tokenization and easier customization per theme, otherwise you'd have to override the selectors themselves | ||
| $euiTitles: ( | ||
| 'xxxs': ( | ||
| 'font-size': $euiFontSizeXS, | ||
| 'line-height': lineHeightFromBaseline(3), | ||
| 'font-weight': $euiFontWeightBold, | ||
| ), | ||
| 'xxs': ( | ||
| 'font-size': $euiFontSizeS, | ||
| 'line-height': lineHeightFromBaseline(3), | ||
| 'font-weight': $euiFontWeightBold, | ||
| ), | ||
| 'xs': ( | ||
| 'font-size': $euiFontSize, | ||
| 'line-height': lineHeightFromBaseline(3), | ||
| 'font-weight': $euiFontWeightSemiBold, | ||
| 'letter-spacing': -.02em, | ||
| ), | ||
| 's': ( | ||
| 'font-size': $euiFontSizeL, | ||
| 'line-height': lineHeightFromBaseline(4), | ||
| 'font-weight': $euiFontWeightMedium, | ||
| 'letter-spacing': -.025em, | ||
| ), | ||
| 'm': ( | ||
| 'font-size': $euiFontSizeXL, | ||
| 'line-height': lineHeightFromBaseline(5), | ||
| 'font-weight': $euiFontWeightLight, | ||
| 'letter-spacing': -.04em, | ||
| ), | ||
| 'l': ( | ||
| 'font-size': $euiFontSizeXXL, | ||
| 'line-height': lineHeightFromBaseline(6), | ||
| 'font-weight': $euiFontWeightLight, | ||
| 'letter-spacing': -.03em, | ||
| ), | ||
| ) !default; | ||
| $euiLineHeight: 1.5 !default; | ||
This file contains hidden or 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,4 @@ | ||
| **Bug fixes** | ||
|
|
||
| - Fixed unexpected results for the SCSS function `lineHeightFromBaseline` | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.