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

Commit

Permalink
fix(Segment): add background color (#408)
Browse files Browse the repository at this point in the history
* fix(Segment): add background color

* cleanup variables
  • Loading branch information
levithomason authored Oct 29, 2018
1 parent 79ba776 commit 37f4fd1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Add warning for rendering components outside provider @Bugaa92 ([#378](https://github.com/stardust-ui/react/pull/378))
- Fix icon colors for Teams theme @codepretty ([#384](https://github.com/stardust-ui/react/pull/384))
- Do not render the Attachment's `progress` value to the DOM @levithomason ([#402](https://github.com/stardust-ui/react/pull/402))
- Add Segment background color @levithomason ([#408](https://github.com/stardust-ui/react/pull/408))

### Features
- Export `mergeThemes` @levithomason ([#285](https://github.com/stardust-ui/react/pull/285))
Expand Down
2 changes: 2 additions & 0 deletions src/themes/teams/componentVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export { default as PopupContent } from './components/Popup/popupContentVariable

export { default as RadioGroupItem } from './components/RadioGroup/radioGroupItemVariables'

export { default as Segment } from './components/Segment/segmentVariables'

export { default as Status } from './components/Status/statusVariables'

export { default as Text } from './components/Text/textVariables'
11 changes: 6 additions & 5 deletions src/themes/teams/components/Segment/segmentStyles.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { pxToRem } from '../../../../lib'
import { ICSSInJSStyle } from '../../../types'
import { SegmentVariables } from './segmentVariables'

export default {
root: (): ICSSInJSStyle => {
root: ({ variables }: { variables: SegmentVariables }): ICSSInJSStyle => {
return {
padding: '1em',
boxShadow: '0 1px 2px 0 rgba(34,36,38,.15)',
padding: variables.padding,
background: variables.background,
border: '1px solid rgba(34,36,38,.15)',
borderRadius: pxToRem(5),
borderRadius: variables.borderRadius,
boxShadow: '0 1px 2px 0 rgba(34,36,38,.15)',
}
},
}
16 changes: 16 additions & 0 deletions src/themes/teams/components/Segment/segmentVariables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { pxToRem } from '../../../../lib'
import { ComponentVariablesPrepared } from '@stardust-ui/react'

export interface SegmentVariables {
padding: string
background: string
borderRadius: string
}

const segmentVariables: ComponentVariablesPrepared = siteVariables => ({
padding: '1em',
background: siteVariables.bodyBackground,
borderRadius: pxToRem(5),
})

export default segmentVariables

0 comments on commit 37f4fd1

Please sign in to comment.