pulsar/docs/theme-variables.md

117 lines
2.8 KiB
Markdown
Raw Normal View History

2013-10-25 02:08:32 +04:00
# Style variables
2013-10-31 01:37:13 +04:00
Atom's UI provides a set of variables you can use in your own themes and packages.
2013-10-25 02:08:32 +04:00
2013-10-31 01:37:13 +04:00
## Use in Themes
2013-10-25 02:08:32 +04:00
2013-10-31 01:37:13 +04:00
Each custom theme must specify a `ui-variables.less` file with all of the
following variables defined. The top-most theme specified in the theme settings
will be loaded and available for import.
2013-10-25 02:08:32 +04:00
2013-10-31 01:37:13 +04:00
## Use in Packages
2013-10-25 02:08:32 +04:00
2013-10-31 01:37:13 +04:00
In any of your package's `.less` files, you can access the theme variables
2013-10-31 02:21:51 +04:00
by importing the `ui-variables` file from Atom.
2013-10-25 02:08:32 +04:00
2013-10-31 01:37:13 +04:00
Your package should generally only specify structural styling, and these should
2013-10-31 02:21:51 +04:00
come from [the style guide][styleguide]. Your package shouldn't specify colors,
2013-10-31 01:37:13 +04:00
padding sizes, or anything in absolute pixels. You should instead use the theme
variables. If you follow this guideline, your package will look good out of the
box with any theme!
Here's an example `.less` file that a package can define using theme variables:
2013-10-25 02:08:32 +04:00
```css
@import "ui-variables";
.my-selector{
background-color: @base-background-color;
padding: @component-padding;
}
```
## Variables
### Text colors
* `@text-color`
* `@text-color-subtle`
* `@text-color-highlight`
* `@text-color-selected`
* `@text-color-info` - A blue
* `@text-color-success`- A green
* `@text-color-warning`- An orange or yellow
* `@text-color-error` - A red
### Background colors
* `@background-color-info` - A blue
* `@background-color-success` - A green
* `@background-color-warning` - An orange or yellow
* `@background-color-error` - A red
* `@background-color-highlight`
* `@background-color-selected`
* `@app-background-color` - The app's background under all the editor components
### Component colors
* `@base-background-color` -
* `@base-border-color` -
* `@pane-item-background-color` -
* `@pane-item-border-color` -
* `@input-background-color` -
* `@input-border-color` -
* `@tool-panel-background-color` -
* `@tool-panel-border-color` -
* `@inset-panel-background-color` -
* `@inset-panel-border-color` -
* `@panel-heading-background-color` -
* `@panel-heading-border-color` -
* `@overlay-background-color` -
* `@overlay-border-color` -
* `@button-background-color` -
* `@button-background-color-hover` -
* `@button-background-color-selected` -
* `@button-border-color` -
* `@tab-bar-background-color` -
* `@tab-bar-border-color` -
* `@tab-background-color` -
* `@tab-background-color-active` -
* `@tab-border-color` -
* `@tree-view-background-color` -
* `@tree-view-border-color` -
* `@ui-site-color-1` -
* `@ui-site-color-2` -
* `@ui-site-color-3` -
* `@ui-site-color-4` -
* `@ui-site-color-5` -
### Component sizes
* `@disclosure-arrow-size` -
* `@component-padding` -
* `@component-icon-padding` -
* `@component-icon-size` -
* `@component-line-height` -
* `@component-border-radius` -
* `@tab-height` -
### Fonts
* `@font-size` -
* `@font-family` -
2013-10-31 01:37:13 +04:00
[styleguide]: https://github.com/atom/styleguide