feat: Toolbar Header
This commit is contained in:
1 parent
f8bbee22b7
commit
b3dff5ddee
11 files changed
+208
-17
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
import tailwindConfig from '../../../tailwind.config';
|
||||
|
||||
const BackgroundColor = ({ color }) => {
|
||||
const getColorValue = () => {
|
||||
const currentColor = color.split('-');
|
||||
const { colors } = tailwindConfig.theme;
|
||||
return colors[currentColor[0]][currentColor[1]];
|
||||
};
|
||||
return (
|
||||
<div
|
||||
className={classnames(
|
||||
`mb-4 w-56 h-10 flex items-center justify-center flex-col text-white text-lg bg-${color} py-8`
|
||||
)}
|
||||
>
|
||||
<p>{getColorValue()}</p>
|
||||
<p>bg-{color}</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
BackgroundColor.propTypes = {
|
||||
color: PropTypes.string,
|
||||
};
|
||||
|
||||
export default BackgroundColor;
|
||||
@@ -0,0 +1,83 @@
|
||||
---
|
||||
name: Colors
|
||||
route: system/colors
|
||||
---
|
||||
|
||||
import { Playground, Props } from 'docz';
|
||||
import BackgroundColor from './BackgroundColor';
|
||||
|
||||
# Color System
|
||||
|
||||
`@ohif/ui` offers a color system with a handful of color utility classes.
|
||||
|
||||
As `@ohif/ui` uses Tailwind as a base styling library, you will be able to use
|
||||
all the default colors from Tailwind, besides our custom colors too.
|
||||
|
||||
# How to use
|
||||
|
||||
To apply color in your element, you will use the same way Tailwind does.
|
||||
|
||||
- Background - `bg-primary-main`
|
||||
- Border - `border-primary-main`
|
||||
- Text - `text-primary-main`
|
||||
- Placeholder - `placeholder-primary-main`
|
||||
|
||||
Check [Tailwind's documentation](https://tailwindcss.com/docs) to see more
|
||||
details about color classes.
|
||||
|
||||
# Examples
|
||||
|
||||
## Text
|
||||
|
||||
<Playground>
|
||||
<div className="p-8">
|
||||
<p className="text-common-bright">text-common-bright</p>
|
||||
<p className="text-common-light">text-common-light</p>
|
||||
<p className="text-common-main">text-common-main</p>
|
||||
<p className="text-common-dark">text-common-dark</p>
|
||||
<p className="text-common-active">text-common-active</p>
|
||||
</div>
|
||||
</Playground>
|
||||
|
||||
## Background
|
||||
|
||||
<div className="flex">
|
||||
<div className="mr-8">
|
||||
<BackgroundColor color="primary-light" />
|
||||
<BackgroundColor color="primary-main" />
|
||||
<BackgroundColor color="primary-dark" />
|
||||
<BackgroundColor color="primary-active" />
|
||||
</div>
|
||||
<div>
|
||||
<BackgroundColor color="secondary-light" />
|
||||
<BackgroundColor color="secondary-main" />
|
||||
<BackgroundColor color="secondary-dark" />
|
||||
<BackgroundColor color="secondary-active" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
# Color palette
|
||||
|
||||
```javascript
|
||||
primary: {
|
||||
light: '#5acce6',
|
||||
main: '#0944b3',
|
||||
dark: '#090c29',
|
||||
active: '#348cfd',
|
||||
},
|
||||
|
||||
secondary: {
|
||||
light: '#3a3f99',
|
||||
main: '#2b166b',
|
||||
dark: '#041c4a',
|
||||
active: '#1f1f27',
|
||||
},
|
||||
|
||||
common: {
|
||||
bright: '#e1e1e1',
|
||||
light: '#a19fad',
|
||||
main: '#fff',
|
||||
dark: '#726f7e',
|
||||
active: '#2c3074',
|
||||
},
|
||||
```
|
||||
Reference in new issue
Block a user