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

Update tokens #7

Merged
merged 7 commits into from
Sep 18, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "CSS variables for use on WRAP's Web Properties",
"scripts": {
"build": "sass src/main.scss dist/index.css",
"build": "sass src/main.scss dist/index.css && cp src/tokens/breakpoint.scss dist/breakpoint.scss",
"prestart": "npm install && husky",
"release": "semantic-release",
"start": "sass --watch src/main.scss dist/index.css",
Expand Down
1 change: 0 additions & 1 deletion src/main.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@use 'tokens/breakpoint';
@use 'tokens/button';
@use 'tokens/color';
@use 'tokens/container-color';
Expand Down
25 changes: 12 additions & 13 deletions src/tokens/breakpoint.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// Not sure if these can actually be used - don't think you can use CSS variables in media queries. TODO
// CSS variables don't work in media queries
// So these breakpoint tokens are SASS variables instead

:root {
--mobius-breakpoint-xs: 0;
--mobius-breakpoint-sm: 30rem; // 480px
--mobius-breakpoint-md: 37.5rem; // 600px
--mobius-breakpoint-lg: 48rem; // 768px
--mobius-breakpoint-xl: 64rem; // 1024px
--mobius-breakpoint-xxl: 80rem; // 1280px
--mobius-breakpoint-xxxl: 90rem; // 1440px
--mobius-breakpoint-tablet: var(--mobius-breakpoint-lg);
--mobius-breakpoint-desktop: var(--mobius-breakpoint-xl);
--mobius-breakpoint-max: var(--mobius-breakpoint-xxl);
}
$mobius-breakpoint-xs: 0;
$mobius-breakpoint-sm: 30rem; // 480px
$mobius-breakpoint-md: 37.5rem; // 600px
$mobius-breakpoint-lg: 48rem; // 768px
$mobius-breakpoint-xl: 64rem; // 1024px
$mobius-breakpoint-xxl: 80rem; // 1280px
$mobius-breakpoint-xxxl: 90rem; // 1440px
$mobius-breakpoint-tablet: $mobius-breakpoint-lg;
$mobius-breakpoint-desktop: $mobius-breakpoint-xl;
$mobius-breakpoint-max: $mobius-breakpoint-xxxl;
2 changes: 1 addition & 1 deletion src/tokens/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

--mobius-button-background-hover-default: var(--mobius-color-cloud-75);
--mobius-button-border-color-hover-default: var(--mobius-color-forest-50);
--mobius-button-color-hover-default: var(--mobius-color-forest-50);
--mobius-button-color-hover-default: var(--mobius-color-forest-75);

--mobius-button-background-focus-default: var(--mobius-color-cloud);
--mobius-button-border-color-focus-default: var(--mobius-color-forest);
Expand Down
2 changes: 1 addition & 1 deletion src/tokens/radius.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:root {
--mobius-radius-none: 0;
--mobius-radius-xs: 0.125rem;
--mobius-radius-sm: 0.25rem;
--mobius-radius-md: 0.5rem;
--mobius-radius-lg: 1rem;
Expand Down
109 changes: 70 additions & 39 deletions src/tokens/skin.scss
Original file line number Diff line number Diff line change
@@ -1,87 +1,118 @@
:root {
// Have improvised the muted colours for now. Come back to. TODO
// Also link styles. ATM they are mostly all the same as text style
// LIGHT
--mobius-skin-background-light: var(--mobius-color-cloud);
--mobius-skin-background-muted-light: var(--mobius-color-earth-25);
--mobius-skin-background-muted-light: var(--mobius-color-sand-50);

--mobius-skin-border-color-light: var(--mobius-color-forest-25);
--mobius-skin-border-color-muted-light: var(--mobius-color-forest-25);

--mobius-skin-color-light: var(--mobius-color-forest);
--mobius-skin-color-muted-light: var(--mobius-color-forest-75);
--mobius-skin-color-muted-light: var(--mobius-color-forest);
--mobius-skin-heading-color-light: var(--mobius-color-forest);

--mobius-skin-link-color-light: var(--mobius-color-forest);
--mobius-skin-link-color-hover-light: var(--mobius-color-forest-75);
--mobius-skin-link-color-focus-light: var(--mobius-color-forest);
--mobius-skin-link-text-decoration-light: none;
--mobius-skin-link-text-decoration-hover-light: underline;
--mobius-skin-link-text-decoration-light: underline;
--mobius-skin-link-text-decoration-hover-light: none;

// DARK
--mobius-skin-background-dark: var(--mobius-color-forest);
--mobius-skin-background-muted-dark: var(--mobius-color-forest-75);
--mobius-skin-border-color-dark: var(--mobius-color-forest-75);

--mobius-skin-border-color-dark: var(--mobius-color-coal);
--mobius-skin-border-color-muted-dark: var(--mobius-color-forest);

--mobius-skin-color-dark: var(--mobius-color-cloud);
--mobius-skin-color-muted-dark: var(--mobius-color-cloud);
--mobius-skin-heading-color-dark: var(--mobius-color-cloud);

--mobius-skin-link-color-dark: var(--mobius-color-cloud);
--mobius-skin-link-text-decoration-dark: underline;
--mobius-skin-link-text-decoration-hover-dark: underline;
--mobius-skin-link-text-decoration-hover-dark: none;

// INFO
--mobius-skin-background-info: var(--mobius-color-sky-25);
--mobius-skin-background-muted-info: var(--mobius-color-sky-25);
--mobius-skin-background-muted-info: var(--mobius-color-forest-25);

--mobius-skin-border-color-info: var(--mobius-color-sky-25);
--mobius-skin-border-color-muted-info: var(--mobius-color-forest-25);

--mobius-skin-color-info: var(--mobius-color-forest);
--mobius-skin-color-muted-info: var(--mobius-color-forest-75);
--mobius-skin-color-muted-info: var(--mobius-color-forest);
--mobius-skin-heading-color-info: var(--mobius-color-forest);

--mobius-skin-link-color-info: var(--mobius-color-forest);
--mobius-skin-link-text-decoration-info: none;
--mobius-skin-link-text-decoration-hover-info: underline;
--mobius-skin-link-text-decoration-info: underline;
--mobius-skin-link-text-decoration-hover-info: none;

--mobius-skin-background-neutral: var(--mobius-color-sky);
--mobius-skin-background-muted-neutral: var(--mobius-color-sky);
--mobius-skin-border-color-neutral: var(--mobius-color-sky);
--mobius-skin-color-neutral: var(--mobius-color-forest);
--mobius-skin-color-muted-neutral: var(--mobius-color-forest-75);
--mobius-skin-heading-color-neutral: var(--mobius-color-forest);
--mobius-skin-link-color-neutral: var(--mobius-color-forest);
--mobius-skin-link-text-decoration-neutral: underline;
--mobius-skin-link-text-decoration-hover-neutral: underline;
// ATTENTION
--mobius-skin-background-attention: var(--mobius-color-lime-25);
--mobius-skin-background-muted-attention: var(--mobius-color-earth-50);

--mobius-skin-border-color-attention: var(--mobius-color-lime-25);
--mobius-skin-border-color-muted-attention: var(--mobius-color-earth-50);

--mobius-skin-color-attention: var(--mobius-color-forest);
--mobius-skin-color-muted-attention: var(--mobius-color-forest);
--mobius-skin-heading-color-attention: var(--mobius-color-forest);

--mobius-skin-link-color-attention: var(--mobius-color-forest);
--mobius-skin-link-text-decoration-attention: underline;
--mobius-skin-link-text-decoration-hover-attention: none;

// POSITIVE
--mobius-skin-background-positive: var(--mobius-color-lime);
--mobius-skin-background-muted-positive: var(--mobius-color-lime-75);
--mobius-skin-background-muted-positive: var(--mobius-color-earth-50);

--mobius-skin-border-color-positive: var(--mobius-color-lime);
--mobius-skin-border-color-muted-positive: var(--mobius-color-earth-50);

--mobius-skin-color-positive: var(--mobius-color-forest);
--mobius-skin-color-muted-positive: var(--mobius-color-forest);
--mobius-skin-heading-color-positive: var(--mobius-color-forest);

--mobius-skin-link-color-positive: var(--mobius-color-forest);
--mobius-skin-link-text-decoration-positive: underline;
--mobius-skin-link-text-decoration-hover-positive: underline;
--mobius-skin-link-text-decoration-hover-positive: none;

// NEGATIVE
--mobius-skin-background-negative: var(--mobius-color-rose-75);
--mobius-skin-background-muted-negative: var(--mobius-color-rose-75);
--mobius-skin-background-muted-negative: var(--mobius-color-sand);

--mobius-skin-border-color-negative: var(--mobius-color-rose-75);
--mobius-skin-border-color-muted-negative: var(--mobius-color-sand);

--mobius-skin-color-negative: var(--mobius-color-forest);
--mobius-skin-color-muted-negative: var(--mobius-color-forest-75);
--mobius-skin-color-muted-negative: var(--mobius-color-forest);
--mobius-skin-heading-color-negative: var(--mobius-color-forest);

--mobius-skin-link-color-negative: var(--mobius-color-forest);
--mobius-skin-link-text-decoration-negative: underline;
--mobius-skin-link-text-decoration-hover-negative: underline;
--mobius-skin-link-text-decoration-hover-negative: none;

--mobius-skin-background-attention: var(--mobius-color-lime-25);
--mobius-skin-background-muted-attention: var(--mobius-color-lime-25);
--mobius-skin-border-color-attention: var(--mobius-color-lime-25);
--mobius-skin-color-attention: var(--mobius-color-forest);
--mobius-skin-color-muted-attention: var(--mobius-color-forest-75);
--mobius-skin-heading-color-attention: var(--mobius-color-forest);
--mobius-skin-link-color-attention: var(--mobius-color-forest);
--mobius-skin-linktext-decoration-attention: underline;
--mobius-skin-linktext-decoration-hover-attention: underline;
// NEUTRAL
--mobius-skin-background-neutral: var(--mobius-color-sky);
--mobius-skin-background-muted-neutral: var(--mobius-color-forest-25);

--mobius-skin-border-color-neutral: var(--mobius-color-sky);
--mobius-skin-border-color-muted-neutral: var(--mobius-color-forest-25);

--mobius-skin-color-neutral: var(--mobius-color-forest);
--mobius-skin-color-muted-neutral: var(--mobius-color-forest);
--mobius-skin-heading-color-neutral: var(--mobius-color-forest);

--mobius-skin-link-color-neutral: var(--mobius-color-forest);
--mobius-skin-link-text-decoration-neutral: underline;
--mobius-skin-link-text-decoration-hover-neutral: none;

// FALLBACK
--mobius-skin-background: var(--mobius-skin-background-light);
--mobius-skin-background-muted: var(--mobius-skin-background-muted-light);
--mobius-skin-border-color: var(--mobius-skin-border-color-light);
--mobius-skin-border-color-muted: var(--mobius-skin-border-color-muted-light);
--mobius-skin-color: var(--mobius-skin-color-light);
--mobius-skin-color-muted: var(--mobius-skin-color-muted-light);
--mobius-skin-heading-color: var(--mobius-skin-heading-color-light);
--mobius-skin-link-color: var(--mobius-skin-link-color-light);
--mobius-skin-link-color-hover: var(--mobius-skin-link-color-hover-light);
--mobius-skin-link-color-focus: var(--mobius-skin-link-color-focus-light);
--mobius-skin-link-text-decoration: var(
--mobius-skin-link-text-decoration-light
);
Expand Down