diff --git a/.changeset/itchy-spoons-sort.md b/.changeset/itchy-spoons-sort.md new file mode 100644 index 000000000..f2cb19d61 --- /dev/null +++ b/.changeset/itchy-spoons-sort.md @@ -0,0 +1,5 @@ +--- +'@microsoft/atlas-site': minor +--- + +Update color atomics documentation. diff --git a/.vscode/semantic-color-table.code-snippets b/.vscode/semantic-color-table.code-snippets new file mode 100644 index 000000000..47c4f62dd --- /dev/null +++ b/.vscode/semantic-color-table.code-snippets @@ -0,0 +1,50 @@ +{ + // Place your atlas-design workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and + // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope + // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is + // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: + // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. + // Placeholders with the same ids are connected. + // Example: + "Semantic color table": { + "scope": "markdown", + "prefix": "Semantic", + "body": [ + "", + "\t", + "\t", + "\t\t", + "\t\t\t", + "\t\t\t", + "\t\t\t", + "\t\t", + "\t", + "\t", + "\t\t", + "\t\t\t", + "\t\t\t", + "\t\t\t", + "\t\t", + "\t\t", + "\t\t\t", + "\t\t\t", + "\t\t\t", + "\t\t", + "\t\t", + "\t\t\t", + "\t\t\t", + "\t\t\t", + "\t\t", + "\t\t", + "\t\t\t", + "\t\t\t", + "\t\t\t", + "\t\t", + "\t", + "
", + "\t\t${1:textlabel} color classes", + "\t
Background color /
Text color
Text classBackground class
${1:textlabel} invert /
${1:textlabel}
.color-${2:textlabel}.background-color-${2:textlabel}-invert
${1:textlabel} light /
${1:textlabel} dark
N/A.background-color-${2:textlabel}-light
${1:textlabel} /
${1:textlabel} invert
.color-${2:textlabel}-invert.background-color-${2:textlabel}
${1:textlabel} dark /
${1:textlabel} invert
.color-${2:textlabel}-invert.background-color-${2:textlabel}-dark
" + ], + "description": "A table that can showcase a semantic color" + } +} diff --git a/integration/config/page.ts b/integration/config/page.ts index d17f38e61..912da53d6 100644 --- a/integration/config/page.ts +++ b/integration/config/page.ts @@ -29,6 +29,7 @@ export const pages: LocalPageConfig[] = [ // { pathname: '/atomics/spacing.html', name: 'Atomics/spacing', routes }, // { pathname: '/atomics/typography.html', name: 'Atomics/typography', routes }, // { pathname: '/atomics/width.html', name: 'Atomics/width', routes }, + { pathname: '/atomics/colors.html', name: 'Atomics/colors', routes }, { pathname: '/components/breadcrumbs.html', name: 'Components/breadcrumbs', routes }, { pathname: '/components/button.html', name: 'Components/button', routes }, { pathname: '/components/checkbox.html', name: 'Components/checkbox', routes }, diff --git a/site/src/atomics/colors.md b/site/src/atomics/colors.md new file mode 100644 index 000000000..2053c9a15 --- /dev/null +++ b/site/src/atomics/colors.md @@ -0,0 +1,229 @@ +--- +title: Color +description: Color and background-color related atomic css classes for the Atlas Design System +template: standard +classType: Atomics +classPrefixes: + - color + - background-color +--- + +# Color Atomics + +Atlas has CSS classes that allow you to easily apply themed background and text colors. Change the site's theme to see how each looks in different themes. + +## Accessibility concerns + +Atlas components ensure accessible text-to-background color contrast ratios. However, when applying specific colors yourself via atomics, always remember to test contrast. + +## Text colors + +Atlas has three themed text colors. + + + + + + + + + + + + + + + + + + + + + + + +
+ Text color classes +
Text colorText class
Text.color-text
Text subtle.color-text-subtle
Text invert.color-text-invert
+ +## Background colors + +Atlas has five themed (non-semantic) background colors. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Body color classes +
Background colorBackground class
Body.background-color-body
Body medium.background-color-body-medium
Body accent.background-color-body-accent
Alternate.background-color-alternate
Alternate medium .background-color-alternate-medium
+ +## Semantic colors + +Semantic colors are themed colors that vary depending on the active theme. They have names that pertain to their usage. Generally speaking, these are the colors used to paint components too. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Primary color classes +
Background color /
Text color
Font classBackground class
Primary invert /
Primary
.color-primary.background-color-primary-invert
Primary light /
Primary dark
N/A.background-color-primary-light
Primary /
Primary invert
.color-primary-invert.background-color-primary
Primary dark /
Primary invert
.color-primary-invert.background-color-primary-dark
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Success color classes +
Background color /
Text color
Font classBackground class
Success invert /
Success
.color-success.background-color-success-invert
Success light /
Success dark
N/A.background-color-success-light
Success /
Success invert
.color-success-invert.background-color-success
Success dark /
Success invert
.color-success-invert.background-color-success-dark
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Info color classes +
Background color /
Text color
Font classBackground class
Info invert /
Info
.color-info.background-color-info-invert
Info light /
Info dark
N/A.background-color-info-light
Info /
Info invert
.color-info-invert.background-color-info
Info dark /
Info invert
.color-info-invert.background-color-info-dark
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Danger color classes +
Background color /
Text color
Font classBackground class
Danger invert /
Danger
.color-danger.background-color-danger-invert
Danger light /
Danger dark
N/A.background-color-danger-light
Danger /
Danger invert
.color-danger-invert.background-color-danger
Danger dark /
Danger invert
.color-danger-invert.background-color-danger-dark
diff --git a/site/src/tokens/colors.md b/site/src/tokens/colors.md index f008f5784..b8c86bc2b 100644 --- a/site/src/tokens/colors.md +++ b/site/src/tokens/colors.md @@ -7,31 +7,4 @@ token: colors # Colors -Atlas currently supports three themes out of the box. - -## Background Colors - -
-

body

-

.background-color-body

-
- -
-

body-medium

-

.background-color-body-medium

-
- -
-

body-accent

-

.background-color-body-accent

-
- -
-

alternate

-

.background-color-alternate

-
- -
-

alternate-medium

-

.background-color-alternate-medium

-
+Atlas currently supports three themes out of the box. See [atomics/colors](../atomics/colors.md) for examples.