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

15308 Update color variables in CSS #15560

Closed
wants to merge 13 commits into from
Closed
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
4 changes: 4 additions & 0 deletions docroot/design-system/.storybook/cssVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
*/
const postcss = require('postcss');
const postcssExtract = require('@csstools/postcss-extract');
const postcssSass = require('@csstools/postcss-sass');
const fs = require('fs');
const path = require('path');

fs.readFile(path.resolve(__dirname,'../components/tokens/_variables.scss'), (err, css) => {
postcss({
syntax: require('postcss-scss'),
plugins: [
postcssSass(),
postcssExtract({
queries: {
'custom-properties': 'rule[selector*=":root" i] > decl[variable]'
Expand All @@ -37,6 +40,7 @@ fs.readFile(path.resolve(__dirname,'../components/tokens/_variables.scss'), (err
})
]
}).process(css, {
syntax: require('postcss-scss'),
from: path.resolve(__dirname, '../components/tokens/_variables.scss'),
to: '' // don't need a css file here, just want the .json output frm above
}).then(result => {
Expand Down
95 changes: 33 additions & 62 deletions docroot/design-system/.storybook/cssVariables.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,54 @@
{
"custom-properties": {
"--va-gray-lightest": "#e5e3e1",
"--va-gray-lighter": "#e4e2e0",
"--va-gray-light": "#d3d3d3",
"--va-gray-med": "#757576",
"--va-gray-dark": "#595959",
"--va-gray-darker": "#494440",
"--va-gray-lightest": "#f1f1f1",
"--va-gray-med": "#aeb0b5",
"--va-gray-darkest": "#212121",
"--va-gray-cool-lightest": "#f1f4f9",
"--va-gray-cool-lighter": "#e7ecf4",
"--va-gray-cool-light": "#dce4ef",
"--va-gray-cool": "#d1d9e3",
"--va-gray-cool-med": "#aeb0b5",
"--va-gray-cool-dark": "#5b616b",
"--va-gray-cool-darker": "#323a45",
"--va-gray-button-hover": "#c1c2c7",
"--va-blue-lightest": "#f0f6fb",
"--va-blue-lighter": "#e4eff9",
"--va-blue-light": "#d9e8f6",
"--va-blue": "#3e94cf",
"--va-blue-med": "#0071bb",
"--va-blue-dark": "#004795",
"--va-blue-darker": "#003e73",
"--va-blue-darkest": "#112e51",
"--va-blue-bright": "#9bdaf1",
"--va-blue-bright-med": "#02bfe7",
"--va-blue-bright-med-dark": "#00a6d2",
"--va-blue-bright-dark": "#046b99",
"--va-gold-lightest": "#fff1d2",
"--va-gold-lighter": "#fad980",
"--va-gold": "#f9c642",
"--va-gold-med": "#fdb81e",
"--va-green-lightest": "#d5e7d9",
"--va-green-light": "#4aa564",
"--va-gold-dark": "#c58702",
"--va-green-lightest": "#e7f4e4",
"--va-green": "#2e8540",
"--va-green-dark": "#195c27",
"--va-green-alt": "#0fa56f",
"--va-green-alt-bright": "#1bc47d",
"--va-red-lightest": "#f9dede",
"--va-red": "#f24f44",
"--va-red-alt-dark": "#d04037",
"--va-red-bright": "#e31c3d",
"--va-red-dark": "#cd2026",
"--va-red-darker": "#981b1e",
"--va-sky": "#f0f6fb",
"--va-sand": "#fdf5e3",
"--va-blush": "#fbf0ec",
"--va-mint": "#f6fdf4",
"--color-white": "#fff",
"--color-black": "#000",
"--color-textfield-counter-warning": "#C58702",
"--color-textfield-counter-over": "#B20D01",
"--color-sky": "#f0f6fb",
"--color-sand": "#fdf5e3",
"--color-blush": "#fbf0Ec",
"--color-mint": "#f6fdf4",
"--va-white": "#ffffff",
"--va-black": "#212121",
"--color-textfield-counter-warning": "var(--va-gold-dark)",
"--color-textfield-counter-over": "var(--va-red-dark)",
"--color-absolutezero": "var(--va-blue-dark)",
"--color-absolutezero-hover": "var(--va-blue-dark)",
"--color-absolutezero-active": "var(--va-blue-darkest)",
"--color-sunglow": "var(--va-gold-med)",
"--color-maximumred": "var(--va-red-dark)",
"--color-lightninggreen": "var(--va-green-dark)",
"--color-lightgray": "var(--va-gray-lightest)",
"--color-whitesmoke": "var(--va-gray-lightest)",
"--color-text": "var(--va-gray-darkest)",
"--color-grayblue": "var(--va-gray-lightest)",
"--color-davysgray": "var(--va-gray-darkest)",
"--color-bgblue-hover": "var(--va-blue-lightest)",
"--color-bgblue-active": "var(--va-blue-lightest)",
"--button-fg-color--primary": "var(--va-white)",
"--button--hover-bg-color--primary": "#002f62",
"--button-bg-color--primary": "var(--va-blue-dark)",
"--button-bg-color": "var(--va-gray-med)",
"--button--hover-bg-color": "#93969d",
"--input-fg-color-description--alt": "var(--va-gray-darkest)",
"--input--hover-border-color": "var(--va-blue-darkest)",
"--input--disabled-fg-color": "var(--va-gray-darkest)",
"--spacing-xxs": "0.25rem",
"--spacing-xs": "0.5rem",
"--spacing-s": "0.75rem",
"--spacing-m": "1rem",
"--spacing-l": "1.5rem",
"--spacing-ll": "2rem",
"--spacing-xl": "3rem",
"--font-family-sans": "'Source Sans Pro', sans-serif",
"--font-family-serif": "'Bitter', serif",
"--font-family-sans": "\"Source Sans Pro\", sans-serif",
"--font-family-serif": "\"Bitter\", serif",
"--va-display-xl": "48px",
"--va-display-l": "40px",
"--va-display-m": "32px",
Expand All @@ -72,22 +57,8 @@
"--va-subsection-xs": "15px",
"--va-text": "18px",
"--va-helptext": "14px",
"--color-absolutezero": "var(--va-blue-med)",
"--color-absolutezero-hover": "var(--va-blue-dark)",
"--color-absolutezero-active": "var(--va-blue-darker)",
"--color-sunglow": "var(--va-gold-med)",
"--color-maximumred": "var(--va-red-bright)",
"--color-lightninggreen": "var(--va-green)",
"--color-lightgray": "var(--va-gray-lighter)",
"--color-whitesmoke": "var(--va-gray-lightest)",
"--color-text": "var(--va-gray-darkest)",
"--color-grayblue": "var(--va-gray-cool-med)",
"--color-davysgray": "var(--va-gray-med)",
"--color-bgblue-hover": "var(--va-blue-light)",
"--color-bgblue-active": "var(--va-blue-light)",
"--messages__text-margin": "0",
"--input-fg-color-description--alt": "var(--va-gray-dark)",
"--input--hover-border-color": "var(--va-blue-darker)",
"--input--disabled-fg-color": "var(--va-gray-darkest)"
"--focus-outline": "2px dotted transparent",
"--focus-box-shadow": "0 0 0 2px #fff, 0 0 0 5px var(--va-green)"
}
}
2 changes: 1 addition & 1 deletion docroot/design-system/.storybook/storybook-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

.spacer {
background-color: var(--va-blue-light);
background-color: var(--va-blue-lightest);

p {
margin: var(--spacing-xxs);
Expand Down
10 changes: 5 additions & 5 deletions docroot/design-system/components/alert/alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
.va-alert.messages--success,
.va-alert.messages--status {
background-color: var(--va-green-lightest);
border-color: var(--va-green);
border-color: var(--va-green-dark);

svg {
color: var(--va-green);
color: var(--va-green-dark);
}
}

Expand All @@ -63,13 +63,13 @@

.va-alert.messages--error {
background-color: var(--va-red-lightest);
border-color: var(--va-red-bright);
border-color: var(--va-red-dark);

svg {
color: var(--va-red-bright);
color: var(--va-red-dark);
}
}

.va-alert.messages--error a {
background-color: var(--va-red-lightest);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@
width: 100%;

&.information {
background: var(--va-sky);
background: var(--va-blue-lightest);

.title svg {
color: var(--va-blue-bright-med);
color: var(--va-blue-lightest);
}
}

&.warning {
background: var(--va-sand);
background: var(--va-gold-lightest);

.title svg {
color: var(--va-gold-med);
}
}

&.emergency {
background: var(--va-blush);
background: var(--va-red-lightest);

.title svg {
color: var(--va-red);
color: var(--va-red-dark);
}
}

&.new {
background: var(--va-mint);
background: var(--va-green-lightest);

.title svg {
color: var(--va-green);
color: var(--va-green-dark);
}
}

Expand All @@ -61,7 +61,7 @@
margin: 0;

a {
color: var(--va-blue-darker);
color: var(--va-blue-darkest);
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions docroot/design-system/components/button/button.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
a.button--outline,
.button--outline {
background-color: var(--color-white);
border: 2px solid var(--va-blue-med) !important;
border: 2px solid var(--va-blue-dark) !important;
box-shadow: none;
color: var(--va-blue-med);
color: var(--va-blue-dark);
padding: calc(var(--space-m) - 2px) calc(var(--space-l) - 2px); //2px offset for border

&:hover {
background-color: var(--va-blue-light);
border: 2px solid var(--va-blue-darker);
color: var(--va-blue-darker);
background-color: var(--va-blue-lightest);
border: 2px solid var(--va-blue-darkest);
color: var(--va-blue-darkest);
}
}

Expand Down
18 changes: 9 additions & 9 deletions docroot/design-system/components/design-system.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
*/

// tokens
import * as tokens from './tokens';
import * as tokens from "./tokens";

// components
import * as alert from './alert';
import * as button from './button';
import * as icon from './icon';
import * as input from './input';
import * as announcementBlock from './announcement-block';
import * as sitewideAlert from './sitewide-alert';
import * as alert from "./alert";
import * as button from "./button";
import * as icon from "./icon";
import * as input from "./input";
import * as announcementBlock from "./announcement-block";
import * as sitewideAlert from "./sitewide-alert";

const components = {
tokens,
Expand All @@ -22,7 +22,7 @@ const components = {
icon,
input,
announcementBlock,
sitewideAlert
sitewideAlert,
};

/**
Expand All @@ -32,7 +32,7 @@ export default components;

/**
* All component names as an array
* @returns {Array} List of components name strings
* @return {Array} List of components name strings
*/
export const componentNames = () =>
Object.values(components).map(({ name }) => name);
Expand Down
8 changes: 4 additions & 4 deletions docroot/design-system/components/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
// Update to checkbox colors
.form-boolean:active,
.form-boolean:hover {
box-shadow: inset 0 0 0 1px var(--va-blue-darker);
box-shadow: inset 0 0 0 1px var(--va-blue-darkest);
}

.form-boolean:focus:active,
.form-boolean:focus:hover {
box-shadow: 0 0 0 2px var(--color-white), 0 0 0 5px var(--color-focus), inset 0 0 0 1px var(--va-blue-darker);
box-shadow: 0 0 0 2px var(--color-white), 0 0 0 5px var(--color-focus), inset 0 0 0 1px var(--va-blue-darkest);
}

.form-boolean--type-checkbox:checked:active,
.form-boolean--type-checkbox:checked:hover {
background-color: var(--va-blue-darker);
background-color: var(--va-blue-darkest);
}

.form-item--error-message {
color: var(--va-red-bright);
color: var(--va-red-dark);
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.va-site-alert {
padding: 32px 0;
background-color: var(--va-gray-cool-lightest);
color: var(--color-black);
border-top: 8px solid var(--va-gray-dark);
background-color: var(--va-gray-lightest);
color: var(--va-gray-darkest);
border-top: 8px solid var(--va-gray-darkest);

h2 {
font-size: var(--va-subsection-s);
Expand Down Expand Up @@ -35,7 +35,7 @@
}

.va-site-alert--info {
border-top-color: var(--va-blue-bright-med);
border-top-color: var(--va-blue-lightest);
}

.va-site-alert--warning,
Expand Down
Loading
Loading