CSS variables, colors and fonts

Get overview of what CSS variables that are provided by the writer. Also get a good overview of fonts and colors.

CSS variables

General

For using CSS variable you use it with var(--NAME-OF-VARAIBLE) for example if we to use one of our color variables it could look like this color: var(--dw-color-primary). It will pick out the defined color by the Writer so we can easily update this in the future without going over plugins.

Available variables

Color variables

Every CSS color variable starts with the prefix --dw-color-.

General you will just use default color for each predefined color for the Writer and that will be easiest just to use prefix with the name and you will get the default color. For example --dw-color-primary or --dw-color-alert. That is the same as --dw-color-primary-500 or --dw-color-alert-500. Default colors are marked with *.

If you will work with a color in most cases it's enough to work with 100, 300, 500 (default) and 800 to get right feeling.

In color scheme under you can see what text color you have to use together with a specific background color to get correct contrast.

Converted color schema so it searchable

* default value. I.e. var(--dw-color-primary) without number

Utility classes

The Writer provides utilises/helper classes for faster developing but mainly for standardised appearance.

General

.dw-shadow-box

With this class you will apply standard styles for how a shadow box should look in the Writer. This for not getting hundreds different looks for shadows.

Example:

.dw-shadow-border-{COLOR}-{SIZE}

This is created for easy mark up object. In the first case to mark up content parts as restricted. We wanted a standardised this so we easily can changed later on if we wanted.

You can use this we the whole color scheme naming.

Example:

Forms

.dw-form-group

Wrapping class for label and input standardised style

.dw-form-control

Applies to input and textarea for standardised style

<div class="dw-form-group">
    <label>Title</label>
    <input value="" placeholder="Hint about the links destination" class="dw-form-control">
</div>

.dw-form-group-inline-label

Uses together with .dw-form-group to wrap input and label to get label presentation inside input element for a hint.

<div class="dw-form-group dw-form-group-inline-label">
    <label>Title</label>
    <input value="" placeholder="Hint about the links destination" class="dw-form-control">
</div>

States for forms

.is-valid

By combing this stats class with .dw-form-control you get a nice state presentation that the input is valid

<div class="dw-form-group">
    <input class="dw-form-control is-valid" placeholder="Lägg till skapare">
</div>

.is-invalid

By combing this stats class with .dw-form-control you get a nice state presentation that the input is invalid

Blocknodes

A blocknode is represented in the content area often append by a plugin. For example image-plugin, Youtubeembed-plugin and so on.

We have created classes for faster get a unit style. You should following classes together on same object.

<div class="dw-blocknode dw-blocknode--gray dw-blocknode--focus-transparent"></div>

.dw-blocknode

Head class that will add specific display property full width and standard padding to the blocknode.

.dw-blocknode--no-padding

Remove standard padding is for you will have a edge to edge presentation

.dw-blocknode--gray

Some element in the content area att presented with a gray background for mark is placement but not take up to much of the attention.. Use this class to get correct color.

.dw-blocknode--focus-transparent

If you use .dw-blocknode--gray you can use this class to get normal focus state when node is focused or selected.

.dw-blocknode--border-radius

Get standard border-radius applied to block node.

Classes to be used inside dw-blocknode

.dw-blocknode__header

Get standard united style for your header. Adds correct margin to icon if you prepend one.

.dw-blocknode__content