Skip to content

Commit

Permalink
Updating primer/primitives@7.1.0 and adding Light High Contrast theme (
Browse files Browse the repository at this point in the history
…#1755)

* Updating primer/primitives

* Adding light high contrast theme

* Adding light high contrast theme

* Create quiet-spiders-help.md
  • Loading branch information
jonrohan authored Nov 18, 2021
1 parent 3838e17 commit 1714778
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-spiders-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": minor
---

Updating primer/primitives@7.1.0 and adding Light High Contrast theme
35 changes: 28 additions & 7 deletions docs/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,16 @@ export const globalTypes = {
defaultValue: 'light',
toolbar: {
icon: 'circlehollow',
items: ['light', 'light_protanopia', 'dark', 'dark_dimmed', 'dark_high_contrast', 'dark_protanopia', 'all'],
items: [
'light',
'light_colorblind',
'light_high_contrast',
'dark',
'dark_dimmed',
'dark_high_contrast',
'dark_colorblind',
'all'
],
showName: true
}
}
Expand All @@ -119,7 +128,11 @@ export const decorators = [
<Story {...context} />
</div>

<div data-color-mode="light" data-light-theme="light_protanopia" className="story-wrap" id="story">
<div data-color-mode="light" data-light-theme="light_colorblind" className="story-wrap" id="story">
<Story {...context} />
</div>

<div data-color-mode="light" data-light-theme="light_high_contrast" className="story-wrap" id="story">
<Story {...context} />
</div>

Expand All @@ -135,7 +148,7 @@ export const decorators = [
<Story {...context} />
</div>

<div data-color-mode="dark" data-dark-theme="dark_protanopia" className="story-wrap" id="story">
<div data-color-mode="dark" data-dark-theme="dark_colorblind" className="story-wrap" id="story">
<Story {...context} />
</div>
</div>
Expand All @@ -150,9 +163,17 @@ export const decorators = [
)
}

if (context.globals.theme === 'light_protanopia') {
if (context.globals.theme === 'light_colorblind') {
return (
<div data-color-mode="light" data-light-theme="light_colorblind" className="story-wrap" id="story">
<Story {...context} />
</div>
)
}

if (context.globals.theme === 'light_high_contrast') {
return (
<div data-color-mode="light" data-light-theme="light_protanopia" className="story-wrap" id="story">
<div data-color-mode="light" data-light-theme="light_high_contrast" className="story-wrap" id="story">
<Story {...context} />
</div>
)
Expand Down Expand Up @@ -182,9 +203,9 @@ export const decorators = [
)
}

if (context.globals.theme === 'dark_protanopia') {
if (context.globals.theme === 'dark_colorblind') {
return (
<div data-color-mode="dark" data-dark-theme="dark_protanopia" className="story-wrap" id="story">
<div data-color-mode="dark" data-dark-theme="dark_colorblind" className="story-wrap" id="story">
<Story {...context} />
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"storybook": "cd docs && yarn && yarn storybook"
},
"dependencies": {
"@primer/primitives": "^7.0.1"
"@primer/primitives": "^7.1.0"
},
"devDependencies": {
"@changesets/changelog-github": "0.4.1",
Expand Down
1 change: 1 addition & 0 deletions src/color-modes/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

@import './themes/light.scss';
@import './themes/light_colorblind.scss';
@import './themes/light_high_contrast.scss';
@import './themes/dark.scss';
@import './themes/dark_dimmed.scss';
@import './themes/dark_high_contrast.scss';
Expand Down
7 changes: 7 additions & 0 deletions src/color-modes/themes/light_high_contrast.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import "../../support/index.scss";

@import "@primer/primitives/dist/scss/colors/_light_high_contrast.scss";

@include color-mode-theme(light_high_contrast) {
@include primer-colors-light_high_contrast;
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -965,10 +965,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@primer/primitives@^7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@primer/primitives/-/primitives-7.0.1.tgz#bb867672214a561a910f11eabf7babf72c5994ec"
integrity sha512-Ddmi5Fuck3nsHt1+uvZiVzLwtjNrBloWq8FfQz74Qd9TXKxvHxrGxQuEJ21T3PxJMMwwEsKo7fk18oy1rTmFiA==
"@primer/primitives@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@primer/primitives/-/primitives-7.1.0.tgz#944151afb8b0e8ffd33c1cfdc4f873b5dd46cbe5"
integrity sha512-XVM535ieY+ohh82oMCZZwlebsnNtJORR5vpiUk/OLT1KX7pr2aRiSbitFwZ3umo0dw/L5tr6ebSJjRCXLu8UJg==

"@primer/stylelint-config@12.1.0":
version "12.1.0"
Expand Down

0 comments on commit 1714778

Please sign in to comment.