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

Commit

Permalink
feat: a11y colors (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBlomgren authored May 8, 2019
1 parent 85ab18d commit ca236c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/styles/color.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
export default ({ a11yColors = false }) => ({
// BRAND
brandBlue: '#00C8F5',
brandGreen: '#D2F500',
Expand Down Expand Up @@ -30,8 +30,8 @@ export default {

// FUNCTIONAL COLOURS FOR PRODUCT DEVELOPMENT

cta: '#0046FF',
positive: '#00D200',
negative: '#FF1900',
index: '#FFCF00',
};
cta: a11yColors ? '#2D67FF' : '#0046FF',
positive: a11yColors ? '#008A00' : '#00D200',
negative: a11yColors ? '#E81700' : '#FF1900',
index: a11yColors ? '#FFCF00' : '#C15700',
});
9 changes: 4 additions & 5 deletions src/styles/palette.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import color from './color';

export default function createPalette({ type = 'light' }) {
const palette = { ...color };
import createColor from './color';

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

if (!proxyIsAvailable) {
const palette = { ...createColor({ a11yColors }) };
return palette;
}

Expand All @@ -26,7 +25,7 @@ export default function createPalette({ type = 'light' }) {
return {
name: 'nordnet',
type,
...color,
...createColor({ a11yColors }),
color: pinkProxieFactory('.color'),
variant: pinkProxieFactory('.variant'),
// text: pinkProxieFactory('').text,
Expand Down
2 changes: 1 addition & 1 deletion src/styles/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import createMixins from './mixins';

export function createTheme(config = {}) {
const {
palette = createPalette({ type: 'dark' }),
palette = createPalette({ type: 'dark', a11yColors: config.a11yColors }),
breakpoints = createBreakpoints(),
mixins = createMixins(breakpoints),
typography = createTypography(),
Expand Down

1 comment on commit ca236c5

@vercel
Copy link

@vercel vercel bot commented on ca236c5 May 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.