diff --git a/README.md b/README.md index 64d8859..0b86993 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,23 @@ -# Water.css +

+ + On Reddit + On Product Hunt + MIT license +

+ +
+ +

Water.css

+

🌊 A drop-in collection of CSS styles to make simple websites just a little nicer

[![Water.css](logo.svg)](https://watercss.netlify.com/) -_A just-add-css collection of styles to make simple websites just a little nicer_ - -[![On reddit](https://img.shields.io/badge/on-reddit-orange.svg)](https://www.reddit.com/r/webdev/comments/b9m6mv/watercss_a_collection_of_neat_styles_for_simple/) -[![On product hunt](https://img.shields.io/badge/on-product%20hunt-red.svg)](https://www.producthunt.com/posts/water-css) -[![MIT license](https://img.shields.io/github/license/kognise/water.css.svg)](https://github.com/kognise/water.css/blob/master/LICENSE.md) +
## Goals - Responsive -- Good code quality +- Themeable - Good browser support (works on my old kindle's browser :P) - Small size (< 2kb) - Beautiful @@ -20,14 +26,13 @@ _A just-add-css collection of styles to make simple websites just a little nicer ## Why? I commonly make quick demo pages or websites with simple content. For these, I don't want to spend time styling them but don't like the ugliness of the default styles. - -Water.css is a css framework that doesn't require any classes. You just include it in your `` and forget about it, while it silently makes everything nicer. +Water.css is a CSS framework that doesn't require any classes. You just include it in your `` and forget about it, while it silently makes everything nicer. ## Who? -You might want to use Water.css if you're making a simple static or demo website that you don't want to spend time styling. +You might want to use Water.css if you're making a simple static page or demo website that you don't want to spend time styling. -You probably don't want to use it for a production app or something that has more than a simple document. Rule of thumb: if your site has a navbar, don't use Water.css. It's just not meant for that kind of content. +You probably don't want to use it for a production app or something that is more than a simple document. Rule of thumb: if your site has a navbar, don't use Water.css. It's just not meant for that kind of content. ## How? @@ -45,7 +50,7 @@ Just stick this in your ``: ### Other options: -> ⚡ An interactive version selection will be available soon [here](https://watercss.netlify.com/#select-version) +> ⚡ An interactive version selection is available [on the **demo page**!](https://watercss.netlify.com/#installation) #### Enforce a theme and ignore `(prefers-color-scheme)` @@ -54,81 +59,90 @@ For the main versions, `dark` or `light` is only treated as a _default theme_: i #### Want to support Internet Explorer? Sure, just extend the theme prefix with `-legacy`, e.g. `dark-legacy.min.css`. -Be aware that these versions **do not support** [runtime theming](#theming) as they use hard coded values rather than variables. Additionally, if you use a legacy version that is not standalone, we recommend [you add the respective preload tags to improve load times](#). +Be aware that these versions **do not support** [runtime theming](#theming) as they use hard coded values rather than variables. Additionally, if you use a legacy version that is not standalone, we recommend [you add the respective preload tags to improve load times](https://watercss.netlify.com/?legacy#installation). #### Unminified builds All versions are also available as unminified stylesheets, which can be handy during development. Simply remove the `.min` from the file name. -**Oh, you want a demo you say?** Cheeky fellah! [Well, here's your demo.](https://watercss.netlify.com/) - -Don't like how it looks? Feel free to submit an issue or PR with suggestions. - ## Theming -> ⚠ The theming guide is out of date and will be updated shortly! In the meantime, check src/variables-\*.css to see your customization options. +Do you want to make some adjustments or build your own theme completely different from the official dark or light themes? Since Water.css is built with CSS variables this is super easy to do! +You can find a full list of the variables used at [**src/variables-\*.css**](https://github.com/kognise/water.css/tree/master/src/variables-dark.css). -Do you want to make your own theme different from the light or dark themes? Since Water.css is built with Sass this is super easy to do. There are two methods. Also, here's a list of variables to set: +### Runtime theming -- `$background` -- `$background-alt` -- `$text-main` -- `$text-bright` -- `$links` -- `$focus` -- `$border` -- `$code` -- `$button-hover` -- `$animation-duration` -- `$scrollbar-thumb` -- `$scrollbar-thumb-hover` -- `$form-placeholder` -- `$form-text` +> ⚠ If you use a version with support for legacy browsers like Internet Explorer, skip to [Compiling your own theme](#compiling-your-own-theme)! -Wanna quickly try out theming without installing anything or just explore our build environment? +Water.css uses Custom Properties (_"CSS variables"_) to define its base styles such as colors. These can be changed and overwritten right in the browser. +Because of this, you can simply add your own stylesheet to the page and set your own CSS variables there. As long as your stylesheet comes after Water.css in the HTML, your values will override the default ones and your theme is applied! -[![Try on repl.it](https://repl-badge.jajoosam.repl.co/edit.png)](https://repl.it/github/https://github.com/amasad/water.css?lang=nodejs&ref=button) +This short example will use Water.css, but color all links red: -### Based on an existing theme - -You can base your theme off of the existing light or dark themes, which already have some variables predefined to make it easier for you. - -Here's some simple Sass that'll just use the dark theme but color all links red. Of course, you can change any variables you want. - -```scss -$links: #ff0000; -@import 'dark.scss'; +```html + + ``` -### From scratch +If you want to change a value for dark or light mode only, use a media query like so: -You can also make your theme from scratch. This is less recommended, but feel free to! You just have to define all of the variables. - -For example, here's an example of a really ugly theme, made from scratch. **Ouch!** - -```scss -$background: #ff48c2 !default; -$background-alt: #00ff00 !default; - -$text-main: #dbdbdb !default; -$text-bright: #ffffff !default; - -$links: #ff0022 !default; -$focus: #ffc400 !default; -$border: #00ffff !default; -$code: #001aff !default; - -$button-hover: #324759 !default; -$animation-duration: 0.1s !default; - -$form-placeholder: #a9a9a9 !default; -$form-text: #ffffff !default; - -@import 'parts/core'; +```html + ``` -You can also only import parts you want, but this is not recommended. See the `src/parts/` folder for a list of parts. +### Compiling your own theme + +If you are targeting browsers without support for CSS Custom Properties such as Internet Explorer, runtime theming is not an option. To apply your own theming, you'll need to make your changes in the source files themselves, then re-compile the CSS files. This works like the following: + +- Clone the repository to your machine +- Run `yarn` to install dependencies +- Make the theming changes you want in `src/variables-*.css` +- Run `yarn build` to compile the CSS files +- Use the compiled files in the `dist/` directory on your site + +When making your changes, we recommend you don't change the values set by Water.css directly, instead simply add your own variable declarations: + +```css +:root { + /* Water.css variable declarations... */ +} + +/* ⬇ Add this block! */ +:root { + /* Your variable declarations, overriding previous ones */ +} +``` + +You also might want to check out the [Contributing Guide](https://github.com/kognise/water.css/tree/master/.github/CONTRIBUTING.md) as it contains further information about the build setup. + +## Contributing + +Water.css becomes better for everyone when people like you help make it better! + +Have any questions or concerns? Did I forget an element or selector? Does something look ugly? Feel free to submit an issue or pull request. + +If you decide to contribute, after downloading a copy of the repository make sure to run `yarn` to install dependencies useful for development. Then, you can run the following to start a server of the demo with live reloading on change. + +``` +$ yarn dev +``` + +Before submitting your first pull request, make sure to check out our [Contributing Guide](https://github.com/kognise/water.css/tree/master/.github/CONTRIBUTING.md)! +Thanks for taking the time to contribute :) ## Contributing @@ -137,5 +151,5 @@ Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. ## Todos - Add screenshots -- [Jekyll theme](https://github.com/kognise/water.css/issues/18) -- [NPM package](https://github.com/kognise/water.css/issues/41) +- Release Jekyll theme ([#18](https://github.com/kognise/water.css/issues/18)) +- Publish to npm ([#41](https://github.com/kognise/water.css/issues/41))