Settings

Settings are the basis of Obsidian.css, it contains all the variables like spacing, color and font declarations, as well as media queries and a simple theme.


Color

Colors are pretty barebones in Obsidian. They provide sensible defaults to get going with if you're prototyping but have the ability to be overridden. Most of the values are generated from postcss-color-function.

--red
#D04D36
--redLight
#F5DAD6
--redMedium
#D04D36
--redDark
#8B0302
--blue
#147AAB
--blueLight
#CFE4ED
--blueMedium
#147AAB
--blueDark
#004470
--bluegreen
#1D889D
--bluegreenLight
#CDE4E9
--bluegreenMedium
#1D889D
--bluegreenDark
#005064
--yellow
#FFBA00
--yellowLight
#FFDD83
--yellowMedium
#FFBA00
--yellowDark
#B97F00
--ygreen
#CEE89C
--ygreenLight
#D1E9A3
--ygreenMedium
#CEE89C
--ygreenDark
#90AA62
--green
#6CC034
--greenLight
#CCE9E9
--greenMedium
#6CC034
--greenDark
#278300
--orange
#E36511
--orangeLight
#F8DBC7
--orangeMedium
#E36511
--orangeDark
#9C2900
--purple
#834F91
--purpleLight
#E7DDEA
--purpleMedium
#834F91
--purpleDark
#4A1958
--indigo
#675996
--indigoLight
#E1DFEB
--indigoMedium
#675997
--indigoDark
#2F265D
--fuchsia
#FA5E5B
--fuchsiaLight
#FDD7D7
--fuchsiaMedium
#FA5E5B
--fuchsiaDark
#B31528
--offwhite
#FDFDFD
--black
#202020
--palegray
#F7F7F7
--gray
#CCC
--text
#484848
--litegray
#BCBCBC

Media Queries

This project uses mobile-first media queries, meaning that a base set of styles is targeted and then styled conditionally for increasing larger viewports. --sm targets viewports 500px wide and larger, --md targets viewports 768px wide and larger, --lg targets viewports 924px wide and larger, finally --xl targets 1200px and wider.

Before, this projected used postcss-custom-media, but now just uses standard media queries.

@custom-media --sm only screen and (width >= 31.25rem);
@custom-media --md only screen and (width >= 48rem);
@custom-media --lg only screen and (width >= 57.75rem);
@custom-media --xl only screen and (width >= 75rem);

Global Defaults

There are lots of default declarations in this project, notably Obsidian uses a base space of 1rem for most things, 100% for an initial font-size, a base container size of 75rem (~1200px) and default of 375 milliseconds for transitions. For information about rem units check out The Lengths of CSS from CSS-Tricks.

For font families themselves, there's a few font stacks (that you should override for your needs) for sans-serif, serif and monospace fonts; plus there's a system font stack. The current default font is the system font stack.

Theme

The theme portion of Obsidian is admittedly in serious flux. Expect this module to change. The main thing that's useful for is to easily override font families quickly, so when you install Obsidian.css you can contour it to your needs.

Blue is the main color for buttons, links, form UI values, color-1 provides an easy handle to override it.

:root {
  /* Colors */
  --color-1: var(--blue);
  --color-2: var(--red);
  --color-3: var(--yellow);
  --color-4: var(--bluegreen);
  --color-5: var(--litegray);

  /* Font Choices */
  --headlines: var(--ff-sans-serif);
  --default: var(--ff-sans-serif);
  --body-text: var(--ff-serif);
}

Overriding Values

To override a default value in Obsidian.css specify in a :root declaration after the @import statements. For more information about CSS variables checkout Using CSS variables from MDN and the this playground.

@import 'obsidian.css';

:root {
  --ff-sans-serif: 'Proxima Nova', 'Avenir Next', 'Helvetica Neue', sans-serif;
}

Install Obsidian.css

yarn add obsidian.css