Skip to content

Commit ef53169

Browse files
committed
feat!: more granular font weight vars
1 parent 4f4ddce commit ef53169

8 files changed

Lines changed: 178 additions & 26 deletions

File tree

src/components/Breadcrumbs/Breadcrumbs.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $block: '.#{variables.$ns}breadcrumbs';
2424

2525
&_current {
2626
box-sizing: content-box;
27-
font-weight: var(--g-text-accent-font-weight);
27+
font-weight: var(--g-text-body-accent-font-weight);
2828
overflow: hidden;
2929
margin: -2px;
3030
padding: 2px;

src/components/Menu/Menu.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use '../../../styles/mixins';
21
@use '../variables';
32

43
$block: '.#{variables.$ns}menu';
@@ -86,7 +85,7 @@ $block: '.#{variables.$ns}menu';
8685
}
8786

8887
&__group-label {
89-
@include mixins.text-accent();
88+
font-weight: var(--g-text-body-accent-font-weight);
9089
color: var(--g-color-text-hint);
9190
}
9291

src/components/controls/TextArea/TextArea.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ $block: '.#{variables.$ns}text-area';
5454
margin: 0;
5555
padding: 0;
5656
width: 100%;
57-
font-weight: var(--g-text-body-font-weight);
58-
font-family: var(--g-text-body-font-family);
5957
color: inherit;
6058
background-color: transparent;
6159
border: none;

src/components/controls/TextInput/TextInput.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ $block: '.#{variables.$ns}text-input';
8585
margin: 0;
8686
padding: 0;
8787
width: 100%;
88-
font-weight: var(--g-text-body-font-weight);
89-
font-family: var(--g-text-body-font-family);
9088
color: inherit;
9189
background-color: transparent;
9290
border: none;

src/hooks/useColorGenerator/__stories__/ColorInfoPopup.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ $block: '.#{variables.$ns}color-info-popup';
3939
}
4040

4141
&__label {
42-
font-weight: var(--g-text-accent-font-weight);
42+
font-weight: var(--g-text-body-accent-font-weight);
4343
}
4444

4545
&__value-container {

src/stories/Branding/Overview.mdx

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Meta} from '@storybook/addon-docs';
22

3-
<Meta title="Branding/Overview"/>
3+
<Meta title="Branding/Overview" />
44

55
# Branding
66

@@ -13,53 +13,56 @@ you should provide values for each theme individually.
1313
## Basic customization
1414

1515
#### Typography
16+
1617
There are 2 font families, `sans-serif` and `monospace`, which can be configured via `--g-font-family-sans`
1718
and `--g-font-family-monospace`. Also, there are a lot of different text variants: `body-1` `body-2` `caption-1`
1819
`caption-2` `header-1` `header-2` and others. Full list of variants you can find [here](?path=/story/typography--default).
1920
Each of these variants has a specific `font-size` and `line-height` properties which can be configured via variables
2021
`--g-text-{variantName}-font-size` and `--g-text-{variantName}-line-height`. Root node uses `body-1` variant. A `font-weight` property can be set
2122
for each of the variant group (`body` `header` `subheader` `display` `caption` `code`) via `--g-text-{variantGroupName}-font-weight` variable.
22-
There is one specific variable, `--g-text-accent-font-weight`, which can be used separately from text variant.
23-
23+
There are also accent variables for each of the variant group `--g-text-{variantGroupName}-accent-font-weight.
2424

2525
#### Accent
26+
2627
To give a unique look for components you can provide several variables that controls accent color. Here is the
2728
list of such variables:
28-
* `--g-color-base-brand` - Color for background (action button, active controls)
29-
* `--g-color-base-brand-hover` - Hover color for background
30-
* `--g-color-line-brand` - Color for lines (active tab underline)
31-
* `--g-color-text-brand` - Text color
32-
* `--g-color-text-brand-heavy` - Text color over background
33-
* `--g-color-text-brand-contrast` - Text color over brand background
34-
* `--g-color-base-selection` - Lighter version for background (List selection, Table row selection)
35-
* `--g-color-base-selection-hover` - Hover lighter version for background
36-
* `--g-color-text-link` - Color for links
37-
* `--g-color-text-link-hover` - Hover color for links
38-
* `--g-color-text-link-visited` - Color for visited links
39-
* `--g-color-text-link-visited-hover` - Hover color for visited links
29+
30+
- `--g-color-base-brand` - Color for background (action button, active controls)
31+
- `--g-color-base-brand-hover` - Hover color for background
32+
- `--g-color-line-brand` - Color for lines (active tab underline)
33+
- `--g-color-text-brand` - Text color
34+
- `--g-color-text-brand-heavy` - Text color over background
35+
- `--g-color-text-brand-contrast` - Text color over brand background
36+
- `--g-color-base-selection` - Lighter version for background (List selection, Table row selection)
37+
- `--g-color-base-selection-hover` - Hover lighter version for background
38+
- `--g-color-text-link` - Color for links
39+
- `--g-color-text-link-hover` - Hover color for links
40+
- `--g-color-text-link-visited` - Color for visited links
41+
- `--g-color-text-link-visited-hover` - Hover color for visited links
4042

4143
#### Shape
44+
4245
Controls share border radius sizes that can be configured via `--g-border-radius-{size}`, where size is one of xs, s, m, l or xl
4346

4447
### Example
4548

4649
```css
47-
4850
.g-root {
4951
--g-font-family-sans: 'Inter', sans-serif;
5052

53+
--g-text-body-accent-font-weight: 600;
54+
--g-text-caption-accent-font-weight: 600;
5155
--g-text-header-font-weight: 600;
5256
--g-text-subheader-font-weight: 600;
5357
--g-text-display-font-weight: 600;
54-
--g-text-accent-font-weight: 600;
5558

5659
--g-color-base-brand: rgb(117, 155, 255);
5760
--g-color-base-brand-hover: rgb(99, 143, 255);
5861
--g-color-base-selection: rgba(82, 130, 255, 0.05);
5962
--g-color-base-selection-hover: rgba(82, 130, 255, 0.1);
6063
--g-color-line-brand: rgb(117, 155, 255);
6164
--g-color-text-brand: rgb(117, 155, 255);
62-
--g-color-text-brand-contrast: rgb(255, 255 ,255);
65+
--g-color-text-brand-contrast: rgb(255, 255, 255);
6366
--g-color-text-link: rgb(117, 155, 255);
6467
--g-color-text-link-hover: rgb(82, 130, 255);
6568
}

0 commit comments

Comments
 (0)