mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 19:36:20 -05:00
Using grey color by default for some Semantic elements when no color is provided.
This commit is contained in:
parent
335ad7ceb0
commit
d82b7c12fb
6 changed files with 143 additions and 138 deletions
|
|
@ -105,21 +105,29 @@ const invertedNull = (props) => {
|
|||
return props;
|
||||
}
|
||||
|
||||
const defaultGrey = (props, inverted) => {
|
||||
// Some elements look softer when grey, use grey only if another color is not provided.
|
||||
if (inverted) {
|
||||
return {color: 'grey', ...props};
|
||||
}
|
||||
return props;
|
||||
}
|
||||
|
||||
export function Button(props) {
|
||||
const {i} = useContext(ThemeContext);
|
||||
props = {...i, ...props};
|
||||
const {i, inverted} = useContext(ThemeContext);
|
||||
props = defaultGrey({...i, ...props}, inverted);
|
||||
return <BUTTON {...props}/>
|
||||
}
|
||||
|
||||
export function Accordion(props) {
|
||||
const {i} = useContext(ThemeContext);
|
||||
props = {...i, ...props};
|
||||
const {i, inverted} = useContext(ThemeContext);
|
||||
props = defaultGrey({...i, ...props}, inverted);
|
||||
return <ACCORDION {...props}/>
|
||||
}
|
||||
|
||||
export function Header(props) {
|
||||
const {i} = useContext(ThemeContext);
|
||||
props = {...i, ...props};
|
||||
const {i, inverted} = useContext(ThemeContext);
|
||||
props = defaultGrey({...i, ...props}, inverted);
|
||||
return <HEADER {...props}/>
|
||||
}
|
||||
|
||||
|
|
@ -191,8 +199,8 @@ export function Segment(props) {
|
|||
}
|
||||
|
||||
export function Statistic(props) {
|
||||
const {i} = useContext(ThemeContext);
|
||||
props = {...i, ...props};
|
||||
const {i, inverted} = useContext(ThemeContext);
|
||||
props = defaultGrey({...i, ...props}, inverted);
|
||||
return <STATISTIC {...props}/>
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue