diff --git a/CHANGELOG.md b/CHANGELOG.md index 7276e45e685..5bd446e9746 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Unify focus states by leaning into `outline` and restricting to keyboard navigation ([#4242](https://github.com/elastic/eui/pull/4242)) - Removed faux border from `EuiAvatar` ([#4255](https://github.com/elastic/eui/pull/4255)) +- Changed the color and font-weight of inline code block ([#4272](https://github.com/elastic/eui/pull/4272)) ## [`30.3.0`](https://github.com/elastic/eui/tree/v30.3.0) diff --git a/src/components/code/_code_block.scss b/src/components/code/_code_block.scss index d3b80cdef34..10022f9dd20 100644 --- a/src/components/code/_code_block.scss +++ b/src/components/code/_code_block.scss @@ -24,7 +24,7 @@ @include euiCodeFont; display: block; line-height: $euiLineHeight; - font-weight: $euiFontWeightRegular; + font-weight: $euiCodeFontWeightRegular; font-size: inherit; } @@ -180,7 +180,7 @@ .hljs-selector-tag { color: $euiCodeBlockSelectorTagColor; - font-weight: bold; + font-weight: $euiCodeFontWeightBold; } .hljs-string, @@ -274,7 +274,7 @@ } .hljs-strong { - font-weight: bold; + font-weight: $euiCodeFontWeightBold; } .hljs-link { diff --git a/src/global_styling/variables/_typography.scss b/src/global_styling/variables/_typography.scss index c5da09aeed4..a135b93101b 100644 --- a/src/global_styling/variables/_typography.scss +++ b/src/global_styling/variables/_typography.scss @@ -48,11 +48,13 @@ $euiLineHeight: 1.5 !default; $euiBodyLineHeight: 1 !default; // Font weights -$euiFontWeightLight: 300 !default; -$euiFontWeightRegular: 400 !default; -$euiFontWeightMedium: 500 !default; -$euiFontWeightSemiBold: 600 !default; -$euiFontWeightBold: 700 !default; +$euiFontWeightLight: 300 !default; +$euiFontWeightRegular: 400 !default; +$euiFontWeightMedium: 500 !default; +$euiFontWeightSemiBold: 600 !default; +$euiFontWeightBold: 700 !default; +$euiCodeFontWeightRegular: 400 !default; +$euiCodeFontWeightBold: 700 !default; // Titles map // Lists all the properties per EuiTitle size that then gets looped through to create the selectors. diff --git a/src/themes/eui-amsterdam/global_styling/variables/_typography.scss b/src/themes/eui-amsterdam/global_styling/variables/_typography.scss index a5ad37f2822..765e81bc80d 100644 --- a/src/themes/eui-amsterdam/global_styling/variables/_typography.scss +++ b/src/themes/eui-amsterdam/global_styling/variables/_typography.scss @@ -16,6 +16,9 @@ $euiFontSizeXXL: floor($euiFontSize * 2.43); // 34px // h1 $euiBodyLineHeight: 1.142857143; // 16px from a 14px base font size to ensure it aligns to our 16px grid +$euiCodeFontWeightRegular: 400; +$euiCodeFontWeightBold: 700; + // Use 8px increments for base gridline @function lineHeightFromBaseline($multiplier: 3) { @return convertToRem(($euiSize/2)*$multiplier); diff --git a/src/themes/eui-amsterdam/overrides/_code.scss b/src/themes/eui-amsterdam/overrides/_code.scss deleted file mode 100644 index 8aa2ac128a6..00000000000 --- a/src/themes/eui-amsterdam/overrides/_code.scss +++ /dev/null @@ -1,3 +0,0 @@ -.euiCodeBlock--inline { - border-radius: $euiBorderRadiusSmall; -} diff --git a/src/themes/eui-amsterdam/overrides/_code_block.scss b/src/themes/eui-amsterdam/overrides/_code_block.scss new file mode 100644 index 00000000000..e99a112bbbe --- /dev/null +++ b/src/themes/eui-amsterdam/overrides/_code_block.scss @@ -0,0 +1,8 @@ +.euiCodeBlock.euiCodeBlock--inline { + border-radius: $euiBorderRadiusSmall; + color: makeHighContrastColor($euiColorVis3, $euiCodeBlockBackgroundColor); + + .euiCodeBlock__code { + font-weight: $euiCodeFontWeightBold; + } +} diff --git a/src/themes/eui-amsterdam/overrides/_index.scss b/src/themes/eui-amsterdam/overrides/_index.scss index df44dc2513a..105addb80b5 100644 --- a/src/themes/eui-amsterdam/overrides/_index.scss +++ b/src/themes/eui-amsterdam/overrides/_index.scss @@ -3,7 +3,7 @@ @import 'button_empty'; @import 'button_group'; @import 'call_out'; -@import 'code'; +@import 'code_block'; @import 'context_menu'; @import 'filter_group'; @import 'form_control_layout';