Files
directus/docs/guides/styles.md
Ben Haynes f862f0f8f3 More docs! (#3953)
* Add Quickstart Guide

* Update installation

* Remove unused files

* Update support/backing

* Tweaks in concepts

* Setup file structure for API reference 2.0

* Setup page layout for reference

* Add clean-urls plugin

* getting started updates

* Finish authentication rest

* getting started updates

* Render stylus in 2 spaces

* Various

* Various

* Finish activity docs

* Add collections reference

* Add extension reference

* concepts updates

* Fields/tweaks

* Add files doc

* Add revisions

* concepts docs

* More api reference

* Finish rest api reference (finally)

* initial concepts

* More things

* Add assets api ref

* Move sections from file to assets

* Add environment variables

* contributing docs

* Add field transforms page

* Left align table headers

* concept links

* Add API config

* Fix mobile nav

* Add migrating a project

* doc link fixes

* link fixes

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-02-05 21:31:39 -05:00

2.5 KiB

Styles

Form Follows Function is the guiding design principle of Directus. The minimal UI allows the platform to be easily tailored to your brand. Learn more about the App.

App Themes

The Directus App has been developed with customization and extensibility in mind. Colors and styles referenced within the codebase all use CSS variables, and therefore it is easy to make comprehensive changes to the App styling.

There are two themes included by default: Light and Dark. You can duplicate these files to create your own themes — with no limit to customization. Below are several code resources for key SCSS files.

Project Styling

See Adjusting Project Settings

Custom CSS

You can also override any core CSS directly within the App through Project Settings. This makes it easy to edit the CSS variables listed in the themes above.

  1. Navigate to Settings > Project Settings
  2. Scroll to the CSS Overrides field
  3. Enter any valid CSS
  4. Click the Save action button in the header

Example

Since App styles are inserted/removed whenever a component is rendered, you'll need to be aware of CSS priority. Using :root or body likely isn't scoped enough, you'll need to define a more specific scope, such as #app, or use !important.

#app {
  --family-sans-serif: 'Comic Sans MS';
}

::: warning Action Styling

The --primary variable (and its shades) control call-to-actions and all other elements within the App using the "Directus Blue". While it may be tempting to override this variable with your brand's color, please first review the following warnings:

  • Avoid using yellow, orange, or red hues that give a sense of "danger"
  • Avoid low-contrast colors like yellows, grays, etc, that might not be easily visible
  • Avoid low-saturation colors like black, which might not properly highlight CTAs

:::