All Projects → o-t-w → atomize

o-t-w / atomize

Licence: MIT License
A library of atomic CSS classes.

Programming Languages

SCSS
7915 projects

Projects that are alternatives of or similar to atomize

steller-css
⛰️ A utility-first CSS framework that serves as the foundation of your design system
Stars: ✭ 14 (-72.55%)
Mutual labels:  css-framework, functional-css, atomic-css, utility-classes
hucssley
Hucssley - a full-featured, consistent, atomic utility class library for rapidly building performant UI
Stars: ✭ 79 (+54.9%)
Mutual labels:  design-systems, css-framework, functional-css, utility-classes
Tailwindcss
A utility-first CSS framework for rapid UI development.
Stars: ✭ 50,879 (+99662.75%)
Mutual labels:  responsive, css-framework, functional-css, utility-classes
boardz
Create Pinterest-like boards with pure CSS, in less than 1kB.
Stars: ✭ 33 (-35.29%)
Mutual labels:  responsive, css3, css-library
brevis
CSS at scale
Stars: ✭ 62 (+21.57%)
Mutual labels:  css-framework, functional-css, atomic-css
swatch
A lightweight, modern theming library based on CSS variables and the setter/getter pattern.
Stars: ✭ 14 (-72.55%)
Mutual labels:  css3, css-framework, css-library
Cirrus
☁️ The CSS framework for the modern web.
Stars: ✭ 716 (+1303.92%)
Mutual labels:  responsive, css3, css-framework
adorable-css
Rapid On-Demand Atomic CSS Framework
Stars: ✭ 131 (+156.86%)
Mutual labels:  functional-css, atomic-css, utility-classes
Tachyons
Functional css for humans
Stars: ✭ 11,057 (+21580.39%)
Mutual labels:  design-systems, responsive, functional-css
ekzo
💫 Functional Sass framework for rapid and painless development
Stars: ✭ 32 (-37.25%)
Mutual labels:  responsive, functional-css, atomic-css
Katana
Katana is CSS Layout System made with Flexbox
Stars: ✭ 57 (+11.76%)
Mutual labels:  css3, css-framework, css-library
cra-tailwindcss-in-js
Integrate Tailwind CSS in a Create React App setup using css-in-js solutions
Stars: ✭ 35 (-31.37%)
Mutual labels:  css-framework, utility-classes
strawberry
A new flexbox based CSS micro-framework.
Stars: ✭ 71 (+39.22%)
Mutual labels:  css3, css-framework
aioneframework
Aione Framework: All-in-one lightweight mobile first front-end framework to design websites, web applications, mobile applications, progressive web applications having large number of examples, documentation, tutorials, community support, components.
Stars: ✭ 13 (-74.51%)
Mutual labels:  responsive, css-framework
sass-structure
Sass folder structure => organizing project files.
Stars: ✭ 32 (-37.25%)
Mutual labels:  css3, css-framework
ResetCSS
Reset CSS Stylesheet to reduce browser inconsistencies.
Stars: ✭ 17 (-66.67%)
Mutual labels:  css3, css-library
emma.css
🍴 Emma.css { utility-classes: emmet-like; }
Stars: ✭ 53 (+3.92%)
Mutual labels:  css-framework, utility-classes
uniformcss
A fully configurable utility class generator and CSS framework built for Sass projects.
Stars: ✭ 133 (+160.78%)
Mutual labels:  css-framework, atomic-css
satchel
The little bag of CSS-in-JS superpowers
Stars: ✭ 14 (-72.55%)
Mutual labels:  functional-css, css-library
tachyons-cheatsheet
Interactive cheat sheet for Tachyons 📝
Stars: ✭ 52 (+1.96%)
Mutual labels:  functional-css, atomic-css

Atomize is a library of atomic CSS classes.

Low specificity. Predictable styles.

Utilities apply a single rule or a single piece of functionality. They are designed to be highly reusable.

For more information of this approach to CSS, see:

This project is heavily inspired by Tailwind, Basscss and Tachyons.

Using Atomize

Atomize purposefully keeps things simple. There is no CLI. There are not configuration files.

You can download the files from GitHub. Atomize is also available on NPM.

The compiled CSS is also available to use from the UNPKG CDN.

<link rel="stylesheet" href="https://unpkg.com/@pixelpusher/atomize" />

Staying out of peoples way

Atomize aims to be style neutral.

  • Some margin classes and grid classes are included as a reference implementation and commented out. Define your own depending on your design and use case.
  • colors.scss is included as an example of the recommended way to handle colors. Define your own depending on your design.
  • Atomize does not include breakpoints. Define your own.

Grid classes

The amount of custom layout designs that could be implemented with CSS grid are almost infinite. You can use CSS grid for everything from a small widget to the entire layout of a page. Abstracting such a large amount of options into utility classes is not feasible. Define your own classes for using CSS grid.

At-A-Glance Understandability

Atomize avoids overly abbreviated class names and instead strives for classes that are human-readable and easily understandable.

Escaping special characters

Atomize makes use of the @ symbol, percentage sign, and colons (:) in class names.

These characters have a special meaning in CSS. These characters can be escaped with a backslash to remove their special meaning.

State Variants

To style elements on hover, focus, active or focus-within, use a hover:, focus:, active:, focus-within: prefix.

e.g. given the following classes, the button will have a pink background, while on hover it will have a blue background.

.bg-pink { background-color:pink; }

.hover\:bg-blue:hover { background-color: var(--blue); }
<button class="bg-pink hover:bg-blue">click</button>

Handling media queries

Breakpoints should be defined as Sass variables (CSS custom properties cannot be used for this purpose).

Breakpoint Suffixes

HTML classes that have an impact only at specific screen sizes have a @breakpoint-name prefix.

e.g.:

.font-xl {
  font-size: 75px;
}

@media (max-width: $breakpoint-mobile) {
  .\@sm\:font-l {
    font-size: 50px;
  }
}

Given the following markup, a h1 would be 50 pixels on mobile and 75 pixels on all larger screens.

<h1 class="font-xl @sm:font-l">Lorem Ipsum Heading</h1>

Normalize

Atomize does not include Normalize. The vast majority of Normalize is for dealing with older browsers - particularly old versions of Internet Explorer. Atomize takes a modern approach to browser support. It does not bloat CSS with unneeded styles for obsolete long-dead browsers.

Opinionated Styles

base.scss is opinionated.

It sets box-sizing to border-box for all elements rather than the browser default of content-box.

base.scss also makes working with REM units easier.

Pixel values are generally more intuitive than relative sizes (em's and rem's). However, rem values should be used to size text in order to cater for users who want to enlarge the size of text using there browser settings. Understanding the pixel value of these relative sizes is made obvious.

1rem is computed as 10px. 1.6rem is computed as 16px. 1.7rem is computed as 17px. 5rem is computed as 50px. etc.

Font sizes

It's important to avoid skipping heading levels when structuring your document, as it confuses screen readers. For example, after using an <h2> in your code, the next heading used should be either <h2> or <h3>. If you need a heading to look bigger or smaller to match a specific style, use CSS to override the default size.

Atomize applies styling directly to HTML heading elements, while also defining classes for overrides:

h1, .h1 {}
h2, .h2 {}
h3, .h3 {}
h4, .h4 {}
h5, .h5 {}
h6, .h6 {}

Styling shadow DOM

Classes defined outside of shadow DOM don't work inside of shadow DOM. Atomize does, however, define some CSS custom properties, which can be used. All colors and font sizes are defined as CSS custom properties.

Browser support

The vast majority of classes included here work in all browsers. However, this library is primarily aimed towards modern everygreen browsers. New classes will be added as new CSS features emerge.

CSS features that do not work in Internet Explorer include:

  • CSS custom properties
  • CSS grid
  • display: contents
  • min-content and max-content
  • object-fit
  • position: sticky
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].