Skip to content

Commit

Permalink
💄 Apply default normal style #2008
Browse files Browse the repository at this point in the history
  • Loading branch information
padms committed Dec 19, 2023
1 parent 926932c commit c1c5cc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 1 addition & 9 deletions web/components/src/Backgrounds/BackgroundContainer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,7 @@ describe(`The background container supports different colours from Sanity's colo
expect(container.firstChild).toHaveStyle(`--background-color: var(--bg-mist-blue)`)
})
it('it can be slate blue (default)', () => {
const { container } = render(<BackgroundContainer background="Slate Blue" />)
expect(container.firstChild).toHaveStyle(`--background-color: var(--bg-slate-blue)`)
})
it('Add a class for inverted if the background is so dark that the text must be light for contrast', () => {
const { container } = render(<BackgroundContainer background="Slate Blue" />)
expect(container.firstChild).toHaveClass('inverted-background')
})
it('Add a class for inverted if the background is so dark that the text must be light for contrast', () => {
const { container } = render(<BackgroundContainer background="Mid Blue" />)
expect(container.firstChild).toHaveClass('inverted-background')
expect(container.firstChild).toHaveStyle(`--background-color: var(--bg-mid-blue)`)
})
})
4 changes: 4 additions & 0 deletions web/styles/globalStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import { colors, typography, spacings, componentSettings, strictLineBreak } from
import { generic } from './generic'
import { elements } from './elements'
import { cookieBot, algolia } from './components'
import { normalStyle } from './backgroundThemes'

/* We use ITCSS to structure the (few) global styles we need */
export const GlobalStyle = createGlobalStyle`
/* Settings */
:root{
${normalStyle}
}
${colors}
${typography}
${strictLineBreak}
Expand Down

0 comments on commit c1c5cc5

Please sign in to comment.