@dabapps/roe
Version:
A collection of React components, styles, mixins, and atomic CSS classes to aid with the development of web applications.
95 lines (78 loc) • 3.02 kB
Markdown
#### Example
```js
import { SpacedGroup, Button } from '@dabapps/roe';
<div>
<SpacedGroup block>
<Button>Default</Button>
<Button className="primary">Primary</Button>
<Button className="secondary">Secondary</Button>
<Button className="tertiary">Tertiary</Button>
<Button className="success">Success</Button>
<Button className="warning">Warning</Button>
<Button className="error">Error</Button>
<Button className="info">Info</Button>
</SpacedGroup>
<SpacedGroup block className="margin-top-large">
<Button className="hollow">Hollow</Button>
<Button className="link">Link</Button>
<Button className="pill">Pill</Button>
<Button className="link pill">Link pill</Button>
<Button className="hollow pill">Hollow pill</Button>
<Button className="hollow link">Hollow link</Button>
<Button className="hollow link pill secondary">
Hollow link pill secondary
</Button>
</SpacedGroup>
<SpacedGroup block className="margin-top-large">
<Button block>Block</Button>
</SpacedGroup>
<SpacedGroup block className="margin-top-large">
<Button small>Small</Button>
<Button large>Large</Button>
</SpacedGroup>
</div>;
```
#### Custom buttons
A mixin is available that allows you to define custom button styles.
This should be applied within the selector (element / class) that you want to apply the button styles to.
Note: the background color is used for the text & border of hollow buttons.
```css
.button,
button {
// You must use the mixin within the selectors you want the new class to apply to
// This example will generate selectors for: '.button.custom-light' and 'button.custom-light'
.create-button(custom-light, , );
}
```
You can then use your custom buttons by supplying the name you provided to the mixin as the class name.
```js
import { ContentBox, SpacedGroup, Button } from '@dabapps/roe';
<ContentBox className="grey-background">
<SpacedGroup block className="margin-vertical-base">
<Button className="custom-light">Custom light</Button>
<button className="custom-light hollow">Custom light hollow</button>
</SpacedGroup>
</ContentBox>;
```
#### Less variables
```css
-border-width: 2px;
-text-color-dark: -dark;
-text-color-light: -lightest;
-background-default: -medium;
-background-hollow: transparent;
-border-radius: -radius-base;
-border-radius-pill: 100px;
-padding-vertical-base: -base / 2;
-padding-vertical-large: -large / 2;
-padding-vertical-small: -small / 2;
-padding-horizontal-base: -base;
-padding-horizontal-large: -large;
-padding-horizontal-small: -small;
-size-button: 1em;
-height-button: 1.3em;
-size-button-large: -size-large;
-height-button-large: -height-button;
-size-button-small: -size-small;
-height-button-small: -height-button;
```