Skip to content
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

Amsterdam: better code block contrast #4272

Merged
merged 10 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src-docs/src/theme_amsterdam_light.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// sass-lint:disable no-url-domains, no-url-protocols
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto+Mono:ital,wght@0,500;0,700;1,500;1,700&display=swap');

@import '../../src/theme_amsterdam_light';
@import './components/guide_components';
Expand Down
6 changes: 3 additions & 3 deletions src/components/code/_code_block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@include euiCodeFont;
display: block;
line-height: $euiLineHeight;
font-weight: $euiFontWeightRegular;
font-weight: $euiCodeFontWeightRegular;
font-size: inherit;
}

Expand Down Expand Up @@ -180,7 +180,7 @@

.hljs-selector-tag {
color: $euiCodeBlockSelectorTagColor;
font-weight: bold;
font-weight: $euiCodeFontWeightBold;
}

.hljs-string,
Expand Down Expand Up @@ -274,7 +274,7 @@
}

.hljs-strong {
font-weight: bold;
font-weight: $euiCodeFontWeightBold;
}

.hljs-link {
Expand Down
12 changes: 7 additions & 5 deletions src/global_styling/variables/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Comment on lines +56 to +57
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added these to mainline as well without changing their values. Felt like we needed the separation.


// Titles map
// Lists all the properties per EuiTitle size that then gets looped through to create the selectors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: 500;
$euiCodeFontWeightBold: 700;

// Use 8px increments for base gridline
@function lineHeightFromBaseline($multiplier: 3) {
@return convertToRem(($euiSize/2)*$multiplier);
Expand Down
3 changes: 0 additions & 3 deletions src/themes/eui-amsterdam/overrides/_code.scss

This file was deleted.

4 changes: 4 additions & 0 deletions src/themes/eui-amsterdam/overrides/_code_block.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.euiCodeBlock.euiCodeBlock--inline {
border-radius: $euiBorderRadiusSmall;
color: $euiColorVis3;
}
2 changes: 1 addition & 1 deletion src/themes/eui-amsterdam/overrides/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down