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

fix(themes): add missing typography styles #392

Merged
merged 6 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@
background: $header-background;
color: $header-color;
}

[part='header-title'] {
@include type-category('subtitle-1');
}
2 changes: 2 additions & 0 deletions src/components/card/card.header.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { html, LitElement } from 'lit';
import { themes } from '../../theming/theming-decorator.js';
import { styles as bootstrap } from './themes/light/card.header.bootstrap.css.js';
import { styles as fluent } from './themes/light/card.header.fluent.css.js';
import { styles as indigo } from './themes/light/card.header.indigo.css.js';
import { styles } from './themes/light/card.header.material.css.js';

Expand All @@ -16,6 +17,7 @@ import { styles } from './themes/light/card.header.material.css.js';
*/
@themes({
bootstrap,
fluent,
indigo,
})
export default class IgcCardHeaderComponent extends LitElement {
Expand Down
2 changes: 2 additions & 0 deletions src/components/card/themes/light/card.header.bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
}

::slotted([slot='subtitle']) {
@include type-category('body-1');

color: color(gray, 800);
opacity: 1;
}
10 changes: 10 additions & 0 deletions src/components/card/themes/light/card.header.fluent.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@use './card.header.material.scss';
@use '../../../../styles/utilities' as *;

::slotted([slot='title']) {
@include type-category('subtitle-1');
}

::slotted([slot='subtitle']) {
@include type-category('body-2');
}
2 changes: 2 additions & 0 deletions src/components/checkbox/themes/light/checkbox.bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
}

[part~='label'] {
@include type-category('body-2');

transition: none;
}

Expand Down
4 changes: 4 additions & 0 deletions src/components/checkbox/themes/light/checkbox.fluent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ $disabled-color: var(--disabled-color, color(gray, 400)) !default;
}
}

[part~='label'] {
@include type-category('body-2');
}

[part~='indicator'] {
stroke: color(surface, 500);
stroke-width: 1.5;
Expand Down
4 changes: 4 additions & 0 deletions src/components/checkbox/themes/light/checkbox.indigo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ $disabled-color: var(--disabled-color, color(gray, 300)) !default;
}
}

[part~='label'] {
@include type-category('body-1');
}

[part~='indicator'] {
stroke: color(surface, 500);
transform: scale(.8);
Expand Down
4 changes: 4 additions & 0 deletions src/components/checkbox/themes/light/checkbox.material.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ label {
}
}

[part~='label'] {
@include type-category('subtitle-1');
}

[part~='indicator'] {
stroke: color(surface, 500);
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/checkbox/themes/light/switch.base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ label {
}

[part~='label'] {
@include type-category('subtitle-1');

display: inline-block;
color: color(gray, 900);
cursor: pointer;
Expand Down
4 changes: 4 additions & 0 deletions src/components/checkbox/themes/light/switch.fluent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ $disabled-color: var(--disabled-color, color(gray, 400)) !default;
background: transparent;
}

[part~='label'] {
@include type-category('body-2');
}

:host(:hover) [part~='control'] {
box-shadow: inset 0 0 0 1px $hover-color;
}
Expand Down
1 change: 1 addition & 0 deletions src/components/chip/themes/chip.base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
}

:host button {
@include type-category('body-2');
@include border-radius(rem(16px));

display: flex;
Expand Down
2 changes: 2 additions & 0 deletions src/components/chip/themes/chip.fluent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@use '../../../styles/utilities' as *;

:host button {
@include type-category('subtitle-2');

background: color(gray, 200);
color: color(gray, 700);

Expand Down
2 changes: 2 additions & 0 deletions src/components/input/themes/light/input.bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ $input-background: var(--input-background, #fff) !default;
}

[part='helper-text'] {
@include utils.type-category('body-2');

margin-top: rem(4px);
color: utils.color(gray, 700);
}
Expand Down
8 changes: 8 additions & 0 deletions src/components/list/themes/light/list-item.bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ $item-hover-bg: color(gray, 100) !default;
:host(:last-of-type) {
border-bottom: none;
}

[part='title'] {
@include type-category('body-1');
}

[part='subtitle'] {
@include type-category('subtitle-1');
}
4 changes: 4 additions & 0 deletions src/components/list/themes/light/list-item.fluent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
$separator-color: color(gray, 100) !default;
$item-hover-bg: var(--item-hover-bg, color(gray, 200)) !default;

[part='title'] {
@include type-category('caption');
}

:host {
border-bottom: rem(1px) solid $separator-color;
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/list/themes/light/list-item.indigo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ $subtitle-color: color(gray, 800) !default;
color: $item-color;

[part='subtitle'] {
@include type-category('body-2');

color: $subtitle-color;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/nav-drawer/nav-drawer-header-item.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { html, LitElement } from 'lit';
import { themes } from '../../theming/theming-decorator.js';
import { styles as fluent } from './styles/fluent/nav-drawer-header-item.fluent.css.js';
import { styles as indigo } from './styles/indigo/nav-drawer-header-item.indigo.css.js';
import { styles } from './styles/nav-drawer-header-item.base.css.js';

Expand All @@ -9,7 +10,7 @@ import { styles } from './styles/nav-drawer-header-item.base.css.js';
*
* @slot - Renders the header content
*/
@themes({ indigo })
@themes({ fluent, indigo })
export default class IgcNavDrawerHeaderItemComponent extends LitElement {
public static readonly tagName = 'igc-nav-drawer-header-item';
public static override styles = styles;
Expand Down
3 changes: 2 additions & 1 deletion src/components/nav-drawer/nav-drawer-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from 'lit/decorators.js';
import { themes } from '../../theming/theming-decorator.js';
import { partNameMap } from '../common/util.js';
import { styles as fluent } from './styles/fluent/nav-drawer-item.fluent.css.js';
import { styles as indigo } from './styles/indigo/nav-drawer-item.indigo.css.js';
import { styles } from './styles/nav-drawer-item.base.css.js';

Expand All @@ -22,7 +23,7 @@ import { styles } from './styles/nav-drawer-item.base.css.js';
* @csspart icon - The icon container.
* @csspart content - The content container.
*/
@themes({ indigo })
@themes({ fluent, indigo })
export default class IgcNavDrawerItemComponent extends LitElement {
public static readonly tagName = 'igc-nav-drawer-item';
public static override styles = styles;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@use '../../../../styles/utilities/index' as *;

:host {
@include type-category('caption');
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@use '../../../../styles/utilities/index' as *;

[part='base'] {
@include type-category('body-2');
}
4 changes: 4 additions & 0 deletions src/components/radio/themes/light/radio.base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ input[type='radio'] {
}
}

[part~='label'] {
@include type-category('subtitle-1');
}

[part~='control'] {
@include border-radius(var(--size));

Expand Down
4 changes: 4 additions & 0 deletions src/components/radio/themes/light/radio.fluent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ $disabled-color: var(--disabled-color, utils.color(gray, 400)) !default;
}
}

:host [part~='label'] {
@include utils.type-category('body-2');
}

:host(:hover),
:host(:focus-within) {
[part='control'] {
Expand Down
1 change: 1 addition & 0 deletions src/components/snackbar/themes/snackbar.base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
}

[part~='message'] {
@include type-category('body-2');
@include line-clamp(2, true, true);

flex: 1 1 50%;
Expand Down
4 changes: 4 additions & 0 deletions src/components/snackbar/themes/snackbar.fluent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
min-width: rem(352px);
padding: rem(9px) rem(12px);
}

[part~='message'] {
@include type-category('caption');
}
1 change: 1 addition & 0 deletions src/components/toast/themes/toast.base.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use '../../../styles/utilities' as *;

:host {
@include type-category('body-2');
@include border-radius(rem(26px));

display: inline-flex;
Expand Down