This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Segment): add background color (#408)
* fix(Segment): add background color * cleanup variables
- Loading branch information
1 parent
79ba776
commit 37f4fd1
Showing
4 changed files
with
25 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)', | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |