swlkr / ridgecss

A maximalist css framework for making web apps fast
https://swlkr.com/ridgecss/
155 stars 4 forks source link
alpinejs css css-framework dark-mode

ridge.css

The clearest way into the Universe is through a forest wilderness. - John Muir

ridge.css is a set of classless css themes, layout helpers via pylon.css and optional alpine.js code to help you write fast web apps fast

Usage

Try before you buy! Here's how your html could look after applying ridge.css (with the default dark theme)

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>ridge.css</title>
    <link rel="stylesheet" href="https://github.com/swlkr/ridgecss/blob/master/ridge-dark.css" />
    <link rel="stylesheet" href="https://github.com/swlkr/ridgecss/blob/master/ridge.css" />
  </head>
  <body>
    <vstack spacing="xl">
      <hstack>
        <a href="https://github.com/swlkr/ridgecss/blob/master/">Cool logo</a>
        <spacer></spacer>
        <hstack spacing=s>
          <a href="https://github.com/swlkr/ridgecss/blob/master/pricing">Pricing</a>
          <a href="https://github.com/swlkr/ridgecss/blob/master/join">
            <button>Sign up</button>
          </a>
        </hstack>
      </hstack>

      <vstack align-x="center">
        <h1>Welcome to ridge.css!</h1>
      </vstack>
    </vstack>
  </body>
</html>

Here's a screenshot of how that looks:

screenshot of default dark theme

Install

Download a theme, and add it to your html:

<head>
  <link rel="stylesheet" media="(prefers-color-scheme: light), (prefers-color-scheme: none)" href="https://github.com/swlkr/ridgecss/blob/master/ridge-light.css" />
  <link rel="stylesheet" media="(prefers-color-scheme: dark)" href="https://github.com/swlkr/ridgecss/blob/master/ridge-dark.css" />
  <link rel="stylesheet" href="https://github.com/swlkr/ridgecss/blob/master/ridge.css" />
</head>

The example above adds both light and dark default themes and switches depending on the OS's dark mode setting.