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

feat: extend var theming implementation #465

Merged
merged 4 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 3 additions & 2 deletions src/components/Avatar/avatar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
.wrapper-style {
align-items: center;
display: flex;
font-family: $octuple-font-family;
font-family: var(--avatar-font-family);
justify-content: center;
border-radius: var(--avatar-border-radius);
color: var(--text-inverse-color);

&.red {
Expand Down Expand Up @@ -60,7 +61,7 @@
}

.round-image {
border-radius: 50%;
border-radius: var(--avatar-round-border-radius);
}

.image-style {
Expand Down
16 changes: 7 additions & 9 deletions src/components/Badge/badge.module.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
.badge {
@include octuple-h6();
--bg: var(--grey-color-20);
--label: var(--grey-color-80);
background-color: var(--bg);
background-color: var(--badge-background-color);
border-radius: $space-m;
color: var(--label);
font-family: $octuple-font-family;
color: var(--badge-text-color);
font-family: var(--badge-font-family);
padding: 0 $space-xxs;
width: fit-content;
height: fit-content;

&.active {
--bg: var(--accent-color-30);
--label: var(--primary-color-80);
background-color: var(--badge-active-background-color);
color: var(--badge-active-text-color);

&.disruptive {
--bg: var(--disruptive-color-20);
--label: var(--disruptive-color);
background-color: var(--badge-disruptive-background-color);
color: var(--badge-disruptive-text-color);
}
}
}
2 changes: 1 addition & 1 deletion src/components/Button/button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
border-radius: var(--button-border-radius);
cursor: pointer;
display: inline-block;
font-family: $octuple-font-family;
font-family: var(--button-font-family);
min-height: max-content;
min-width: max-content;
transition: all $motion-duration-extra-fast $motion-easing-easeinout 0s;
Expand Down
10 changes: 4 additions & 6 deletions src/components/Card/card.module.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
.card {
--bg-color: $background-color-white;

background-color: var(--bg-color);
border-radius: $corner-radius-xl;
color: var(--black-color);
background-color: --card-background-color;
border-radius: var(--card-border-radius);
color: var(--card-text-color);
display: block;
font-family: $octuple-font-family;
font-family: var(--card-font-family);
gap: $space-m;
padding: $space-ml;
width: 360px;
Expand Down
25 changes: 11 additions & 14 deletions src/components/InfoBar/infoBar.module.scss
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
.info-bar {
--info-color: var(--grey-color-10);
--bg-color: var(--grey-color-70);

background-color: var(--bg-color);
border-radius: $corner-radius-xl;
color: var(--info-color);
background-color: var(--info-bar-background-color);
border-radius: var(--info-bar-border-radius);
color: var(--info-bar-text-color);
display: flex;
font-family: $octuple-font-family;
gap: $space-m;
padding: $space-ml;
width: 100%;

&.neutral {
--info-color: var(--grey-color-70);
--bg-color: var(--grey-color-10);
background-color: var(--info-bar-background-color);
color: var(--info-bar-text-color);
}

&.positive {
--info-color: var(--green-color-70);
--bg-color: var(--green-color-10);
background-color: var(--info-bar-positive-background-color);
color: var(--info-bar-positive-text-color);
}

&.warning {
--info-color: var(--orange-color-70);
--bg-color: var(--orange-color-10);
background-color: var(--info-bar-warning-background-color);
color: var(--info-bar-warning-text-color);
}

&.disruptive {
--info-color: var(--disruptive-color-70);
--bg-color: var(--disruptive-color-10);
background-color: var(--info-bar-disruptive-background-color);
color: var(--info-bar-disruptive-text-color);
}

.icon {
Expand Down
51 changes: 48 additions & 3 deletions src/styles/themes/_default-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,17 @@
--font-family: 'Source Sans Pro';
--font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
--font-stack-full: var(--font-family), var(--font-stack);
--font-size: 16px;

--anchor-color: var(--primary-color-70);

--border-radius-xs: 2px;
--border-radius-s: 4px;
--border-radius-m: 8px;
--border-radius-l: 16px;
--border-radius-xl: 24px;

// ------ Tabs theme ------
--tab-label: var(--text-secondary-color);
--tab-active-label: var(--primary-color-70);
Expand Down Expand Up @@ -269,7 +278,7 @@
--table-footer-background-color: var(--background-color);
--table-footer-foreground-color: var(--text-primary-color);

--table-border-radius: 24px;
--table-border-radius: var(--border-radius-xl);
--table-border-style: solid;
--table-border-width: 1px;
--table-padding-vertical: 8px;
Expand All @@ -295,9 +304,10 @@
// ------ Table theme ------

// ------ Generic button vars ------
--button-border-radius: 4px;
--button-font-family: var(--font-stack-full);
--button-border-radius: var(--border-radius-s);
--button-round-shape-border-radius: 50%;
--button-pill-shape-border-radius: 24px;
--button-pill-shape-border-radius: var(--border-radius-xl);
// TODO: button text/font related vars
// ------ Generic button vars ------

Expand Down Expand Up @@ -490,4 +500,39 @@
--button-counter-focus-background-color: var(--primary-color-20);
--button-counter-active-background-color: var(--primary-color-10);
// ------ Button Counter theme ------

// ------ Badge theme ------
--badge-font-family: var(--font-stack-full);
--badge-background-color: var(--grey-color-20);
--badge-text-color: var(--grey-color-80);
--badge-active-background-color: var(--accent-color-30);
--badge-active-text-color: var(--primary-color-80);
--badge-disruptive-background-color: var(--disruptive-color-20);
--badge-disruptive-text-color: var(--disruptive-color);
// ------ Badge theme ------

// ------ Avatar theme ------
--avatar-font-family: var(--font-stack-full);
--avatar-border-radius: 0;
--avatar-round-border-radius: 50%;
// ------ Avatar theme ------

// ------ Card theme ------
--card-background-color: var(--background-color);
--card-font-family: var(--font-stack-full);
--card-text-color: var(--black-color);
--card-border-radius: var(--border-radius-xl);
// ------ Card theme ------

// ------ Info Bar theme ------
--info-bar-border-radius: var(--border-radius-xl);
--info-bar-background-color: var(--grey-color-10);
--info-bar-text-color: var(--grey-color-70);
--info-bar-positive-background-color: var(--green-color-10);
--info-bar-positive-text-color: var(--green-color-70);
--info-bar-warning-background-color: var(--orange-color-10);
--info-bar-warning-text-color: var(--orange-color-70);
--info-bar-disruptive-background-color: var(--disruptive-color-10);
--info-bar-disruptive-text-color: var(--disruptive-color-70);
// ------ Info Bar theme ------
}
12 changes: 6 additions & 6 deletions src/styles/themes/_definitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ $picker-outline-color: var(--picker-outline-color);

// BEGIN: NON-COLOR DEFINITIONS

$octuple-font-family: var(--font-family), var(--font-stack);
$octuple-font-family: var(--font-stack-full);

$text-font-size-1: 12px;
$text-font-size-2: 14px;
Expand Down Expand Up @@ -341,11 +341,11 @@ $label-no-value-margin-bottom: 15px;

// Corner-radius Definitions

$corner-radius-xs: 2px;
$corner-radius-s: 4px;
$corner-radius-m: 8px;
$corner-radius-l: 16px;
$corner-radius-xl: 24px;
$corner-radius-xs: var(--border-radius-xs);
$corner-radius-s: var(--border-radius-s);
$corner-radius-m: var(--border-radius-m);
$corner-radius-l: var(--border-radius-l);
$corner-radius-xl: var(--border-radius-xl);

// Speed / Duration Definitions

Expand Down