Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 0265788

Browse files
bcalveryalinais
authored andcommitted
fix(Header): Adding dark and contrast styles for Header (#427)
* adding dark and contrast styles for Header * -added variables in the docs' Header components to always be black
1 parent 2f71e12 commit 0265788

File tree

9 files changed

+40
-9
lines changed

9 files changed

+40
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
2626
- Fix focus behavior for `List` @kuzhelov ([#413](https://github.com/stardust-ui/react/pull/413))
2727
- Remove `Sizes` and `Weights` enums, use typed string in `Text` instead @jurokapsiar ([#446](https://github.com/stardust-ui/react/pull/446))
2828
- Fix React's version in `peerDependencies` @layershifter ([#452](https://github.com/stardust-ui/react/pull/452))
29+
- Added Dark and Contrast theme variables for `Header` @bcalvery ([#427](https://github.com/stardust-ui/react/pull/427))
2930

3031
### Features
3132
- Make `Grid` keyboard navigable by implementing `gridBehavior` @sophieH29 ([#398](https://github.com/stardust-ui/react/pull/398))

docs/src/components/ComponentDoc/ComponentDoc.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ComponentDoc extends React.Component<any, any> {
8080
<Grid>
8181
<Grid.Row style={topRowStyle}>
8282
<Grid.Column>
83-
<Header as="h1" content={info.displayName} />
83+
<Header as="h1" content={info.displayName} variables={{ color: 'black' }} />
8484
<p>{_.join(info.docblock.description, ' ')}</p>
8585
<ComponentAccessibility info={info} />
8686
<ComponentDocSee displayName={info.displayName} />

docs/src/components/ComponentDoc/ComponentDocAccessibility.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ const ComponentDocAccessibility = ({ info }) => {
1919

2020
return (
2121
<>
22-
<Header as="h2" className="no-anchor" content="Accessibility" />
22+
<Header
23+
as="h2"
24+
className="no-anchor"
25+
content="Accessibility"
26+
variables={{ color: 'black' }}
27+
/>
2328

2429
{behaviorName && (
2530
<p>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export { default as Button } from './components/Button/buttonVariables'
22
export { default as Divider } from './components/Divider/dividerVariables'
3+
export { default as Header } from './components/Header/headerVariables'
34
export { default as Input } from './components/Input/inputVariables'
45
export { default as Text } from './components/Text/textVariables'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { HeaderVariables } from '../../../teams/components/Header/headerVariables'
2+
import { Partial } from 'types/utils'
3+
4+
export default (siteVars: any): Partial<HeaderVariables> => {
5+
return {
6+
color: siteVars.white,
7+
descriptionColor: siteVars.gray02,
8+
}
9+
}

src/themes/teams-high-contrast/componentVariables.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
export { default as Avatar } from './components/Avatar/avatarVariables'
2-
32
export { default as Button } from './components/Button/buttonVariables'
4-
53
export { default as Divider } from './components/Divider/dividerVariables'
4+
export { default as Header } from './components/Header/headerVariables'
65

76
export { default as Input } from './components/Input/inputVariables'
87

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { HeaderVariables } from '../../../teams/components/Header/headerVariables'
2+
import { Partial } from 'types/utils'
3+
4+
export default (siteVars: any): Partial<HeaderVariables> => {
5+
return {
6+
color: siteVars.white,
7+
descriptionColor: siteVars.white,
8+
}
9+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export default siteVariables => ({
2-
color: 'rgba(0,0,0,.6)',
2+
color: siteVariables.gray04,
33
})
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
export default siteVariables => ({
2-
color: 'black',
3-
descriptionColor: undefined,
4-
})
1+
export interface HeaderVariables {
2+
color: string
3+
descriptionColor: string
4+
}
5+
6+
export default (siteVars: any): HeaderVariables => {
7+
return {
8+
color: siteVars.black,
9+
descriptionColor: undefined,
10+
}
11+
}

0 commit comments

Comments
 (0)