1
0
mirror of https://github.com/kognise/water.css.git synced 2025-01-17 19:58:13 +01:00
css-water.css/README.md

128 lines
4.5 KiB
Markdown
Raw Normal View History

2019-04-04 16:45:56 -04:00
# Water.css
2019-04-04 17:40:47 -04:00
[![Water.css](logo.svg)](https://kognise.github.io/water.css/)
2019-04-04 16:45:56 -04:00
*A just-add-css collection of styles to make simple websites just a little nicer*
2019-04-05 04:58:21 -04:00
[![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)
2019-04-04 18:00:37 -04:00
2019-04-06 18:28:04 -04:00
## Goals
- Responsive
- Good code quality
- Good browser support (works on my old kindle's browser :P)
- Small size (< 2kb)
- Beautiful
- No classes
2019-04-04 16:45:56 -04:00
## 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 uglyness of the default styles.
Water.css is a css framework that doesn't require any classes. You just include it in your `<head>` 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 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.
## How?
Just stick this in your head:
```html
2019-04-06 18:28:04 -04:00
<link rel='stylesheet' href='https://cdn.jsdelivr.net/gh/kognise/water.css@latest/dist/dark.css'>
2019-04-04 16:45:56 -04:00
```
2019-04-06 18:28:04 -04:00
Well, there's a dark theme and a light theme. If you want the light theme, use `light.css` instead of `dark.css`. See [Theming](#theming) to make your own theme!
2019-04-04 16:45:56 -04:00
2019-04-06 18:28:04 -04:00
No other classes or code is required to make Water.css work. If you want a specific version, you can replace `@latest` with `@version`. See [all the versions](https://github.com/kognise/water.css/releases).
2019-04-04 19:30:11 -04:00
**Oh, you want a demo you say?** Cheeky fellah! [Well, here's your demo.](https://kognise.github.io/water.css/)
2019-04-04 18:53:51 -04:00
2019-04-04 18:54:01 -04:00
Don't like how it looks? Feel free to submit an issue or PR with suggestions.
2019-04-04 17:40:14 -04:00
2019-04-04 16:45:56 -04:00
## Contributing
2019-04-06 18:28:04 -04:00
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.
2019-04-07 01:14:01 +02:00
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 just run the following to start a server of the demo with live reloading and automatic Sass compiling.
2019-04-06 18:28:04 -04:00
```
$ yarn dev
```
And make sure to run `yarn build` before pushing any changes! Thanks for taking the time to contribute :)
## Theming
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:
- `$background`
- `$background-alt`
- `$text-main`
- `$text-bright`
- `$links`
- `$focus`
- `$border`
- `$code`
- `$button-hover`
- `$animation-duration`
- `$form-placeholder`
- `$form-text`
Wanna quickly try theming out without installing anything or just explore our build environment?
[![Try on Repl.it](https://repl-badge.jajoosam.repl.co/try.png)](https://repl.it/@Kognise/watercss-node?ref=button)
2019-04-06 18:28:04 -04:00
### 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.
2019-04-04 16:45:56 -04:00
2019-04-06 18:28:04 -04:00
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';
```
### From scratch
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';
```
You can also only import parts you want, but this is not recommended. See the `src/parts/` folder for a list of parts.
2019-04-04 16:54:05 -04:00
2019-04-05 04:22:45 -04:00
## Todos
2019-04-06 20:05:54 -04:00
- [Blockquotes](https://github.com/kognise/water.css/issues/13)
2019-04-06 18:28:04 -04:00
- Add a screenshot
2019-04-07 01:14:01 +02:00
- Jekyll theme