Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.

Commit ca236c5

Browse files
feat: a11y colors (#629)
1 parent 85ab18d commit ca236c5

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/styles/color.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default {
1+
export default ({ a11yColors = false }) => ({
22
// BRAND
33
brandBlue: '#00C8F5',
44
brandGreen: '#D2F500',
@@ -30,8 +30,8 @@ export default {
3030

3131
// FUNCTIONAL COLOURS FOR PRODUCT DEVELOPMENT
3232

33-
cta: '#0046FF',
34-
positive: '#00D200',
35-
negative: '#FF1900',
36-
index: '#FFCF00',
37-
};
33+
cta: a11yColors ? '#2D67FF' : '#0046FF',
34+
positive: a11yColors ? '#008A00' : '#00D200',
35+
negative: a11yColors ? '#E81700' : '#FF1900',
36+
index: a11yColors ? '#FFCF00' : '#C15700',
37+
});

src/styles/palette.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import color from './color';
2-
3-
export default function createPalette({ type = 'light' }) {
4-
const palette = { ...color };
1+
import createColor from './color';
52

3+
export default function createPalette({ type = 'light', a11yColors = false }) {
64
const proxyIsAvailable = typeof window !== 'undefined' ? 'Proxy' in window : true;
75

86
if (!proxyIsAvailable) {
7+
const palette = { ...createColor({ a11yColors }) };
98
return palette;
109
}
1110

@@ -26,7 +25,7 @@ export default function createPalette({ type = 'light' }) {
2625
return {
2726
name: 'nordnet',
2827
type,
29-
...color,
28+
...createColor({ a11yColors }),
3029
color: pinkProxieFactory('.color'),
3130
variant: pinkProxieFactory('.variant'),
3231
// text: pinkProxieFactory('').text,

src/styles/theme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import createMixins from './mixins';
99

1010
export function createTheme(config = {}) {
1111
const {
12-
palette = createPalette({ type: 'dark' }),
12+
palette = createPalette({ type: 'dark', a11yColors: config.a11yColors }),
1313
breakpoints = createBreakpoints(),
1414
mixins = createMixins(breakpoints),
1515
typography = createTypography(),

0 commit comments

Comments
 (0)