diff --git a/docs/doc-styles.css b/docs/doc-styles.css index dc05992..6d44143 100644 --- a/docs/doc-styles.css +++ b/docs/doc-styles.css @@ -1,3 +1,10 @@ +body.dark { + --body-bg-color: #000; + --font-color: #f5f5f5; + --color-grey: #ccc; + --color-darkGrey: #aaa; +} + body>.container { max-width: 720px; } @@ -26,6 +33,10 @@ body>footer { padding: 4rem; } +body.dark>footer { + background-color: #1a1a1a; +} + section { margin: 5rem auto; } diff --git a/docs/index.html b/docs/index.html index 17e8eca..d6767ac 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,6 +9,7 @@ chota - A micro CSS framework + @@ -26,6 +27,15 @@ start docs GitHub + ☀️ @@ -38,6 +48,7 @@
  • 🌈  Easy to extend with CSS variables
  • 🎲  Comes with a handful of components & utilities
  • ✅  Good Semantics
  • +
  • 🌙  Easy Dark Mode switch
  • 🤡  Supports icons out-of-the-box
  • @@ -107,6 +118,24 @@ } /* Other styles..... */ +{% endhighlight %} +
    +

    Addtionally, you can add dark mode to you site, to support devices that prefer dark mode.

    +{% highlight html %} + + {% endhighlight %}
    diff --git a/src/_base.css b/src/_base.css index 6917e86..6aae87f 100644 --- a/src/_base.css +++ b/src/_base.css @@ -1,4 +1,5 @@ :root { + --body-bg-color: #ffffff; --color-primary: #14854F; --color-lightGrey: #d2d6dd; --color-grey: #747681; @@ -8,6 +9,7 @@ --grid-maxWidth: 120rem; --grid-gutter: 2rem; --font-size: 1.6rem; + --font-color: #333333; --font-family-sans: -apple-system, BlinkMacSystemFont, Avenir, "Avenir Next", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; @@ -27,8 +29,10 @@ html { } body { + background-color: var(--body-bg-color); line-height: 1.6; font-size: var(--font-size); + color: var(--font-color); font-family: "Segoe UI", "Helvetica Neue", sans-serif; /*fallback*/ font-family: var(--font-family-sans); margin: 0; diff --git a/src/_card.css b/src/_card.css index f22aa8b..64591b6 100644 --- a/src/_card.css +++ b/src/_card.css @@ -1,8 +1,8 @@ .card { padding: 1rem 2rem; border-radius: 4px; - background: white; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); + background: var(--body-bg-color); + box-shadow: 0 1px 3px var(--color-grey); } .card p:last-child {