Neat CSS
Extracto
Rapidly build efficient sites with Neat, the minimalist css framework.
Contenido
Rapidly build efficient sites with Neat, the minimalist css framework.
Download
Neat CSS 0.1.0 — 26 September 2022
About
Neat is a simple HTML template. It's tiny, opinionated, and made to last. It's created by Joel Dare and heavily inspired by other minimalist sites like Hundred Rabbits and dozens of similar blogs.
Neat is about 2Kb and that is not minified or compressed. This documentation adds a few more bytes.
"That's pretty neat!"
Getting Started
Grab the neat.css and neat.html files.
curl -O https://neat.joeldare.com/neat.css
curl -O https://neat.joeldare.com/neat.html
Then copy neat.html to index.html and make your changes. Use neat.html as a reference.
Uses
Neat was designed for.
- Blogs
- Journals
- Technical sites
- Documentation
- Books
- Simple shops
Customizing
It's easy to customize Neat. The best way is to create a new custom.css file and then add the following line to the head of your page.
<link rel="stylesheet" type="text/css" href="custom.css">
That will give you the option of updating neat.css without losing any of your personalizations.
Design Decisions
Neat is opinionated and here are some of the design decisions and the rationale for each of them.
Small
In contrast with the majority of the modern web, Neat was designed to be tiny. A side-effect of being small is that it's also very fast.
Low Energy
Because it's small and fast it also consumes fewer resources. It should work well even on the slowest connections. Consuming less energy on both the client and the server.
Long-Lasting
The web is relatively young and technology changes fast but one of the technologies that has lasted as long as the Internet is HTML. There are lots of other interesting formats but plain HTML has a good chance of working well into the future.
Not Minified
Minified code requires the complexity of a transpiler and makes the site less open for inspection, learning, accessibility, and archive. The size trade-off isn't worth it for Neat.
Max Width
The body max-width is 800px by default. Research has shown that limiting the width can lead to better retention of the content itself, as well as a decrease in eye strain. A thinner column of text is more readable on very large monitors. This is simple to change by editing the max-width of the body element in your custom.css file.
Centered Body
The body is centered as of Neat 0.1.0. I use Neat as a starting point for most of my own projects and I found myself centering the body the majority of the time. As a result, the default is now centered. You can still left-align by adding margin-left and margin-right to your custom.css file.
Images
Images are 100% width by default. This works best with images that are wide and short. You can set manual sizes on individual images as it suits you or change the image width in your custom.css if you typically use a different aspect ratio.
Images have no border by default. This works well for dark colored images but light colored images can get lost. Add something like border: 3px solid #404040 if your image needs a border.
Left Aligned
The page is left aligned by default but this is easy to change. If you prefer the page to be centered, set margin-left: auto and margin-right: auto on the body tag in your custom.css file.
Left Gutter
The left gutter is wider at larger sizes, giving the page a little more breathing room at desktop and tablet sizes.
Buttons
There are multiple types of buttons. There are anchor tags (links) that should sometimes look like buttons, button tags, and submit style input tags.
It's best to use semantic web tags whenever possible. Buttons can be a unique case where you're often linking somewhere, but the button tag doesn't support the href attribute. So, buttons can be anchor tags with a class of button.
The html button tag is also styled in the same way. When buttons aren't links, for example when you're using JavaScript to trigger actions from button clicks, the button tag still works.
Input tags of type submit are also styled this way.
<a href="#" class="button">
<button>Button</button>
<input type="submit" value="Button">
Input Fields
The input tag is styled to support light and dark themes.
<input>
No Header
Because of the complexity of the css and the distraction of navigation, there is no header and no navigation, other than the link back to the home page.
Responsive
Neat is designed to be responsive.
Grid
As of v0.1.0 Neat has a simple grid system. Each column is automatically sized. Put in four columns and you'll get four equally sized columns. All columns collapse to a single column on mobile.
<div class="row">
<div class="column">One</div>
<div class="column">Two</div>
<div class="column">Three</div>
<div class="column">Four</div>
</div>
Contributing
Neat is distributed as open-source under the MIT license.
Anything related to Neat is fair game for discussion. Anyone who's interested is welcome to join in the conversation. If you find a problem or have a suggestion, feel free to create an issue on Github. I'm also happy to review code change requests. To do that, fork the project and create a pull request or just email me a diff. Feedback and discussions will lead to better ideas for future improvements.
Centering
You can throw the center class on almost anything you want to center, including a div tag.
Github
You'll find Neat CSS on Github.