All Projects β†’ tomhodgins β†’ Quark

tomhodgins / Quark

Licence: mit
Quark.js is a microscopic atomic CSS polyfill in JS just 140 bytes

Projects that are alternatives of or similar to Quark

Gemma
A lightweight CSS library.
Stars: ✭ 94 (-3.09%)
Mutual labels:  atomic, styling
Vue Promised
πŸ’ Composable Promises & Promises as components
Stars: ✭ 1,325 (+1265.98%)
Mutual labels:  component
Reason Loadable
πŸ”₯ Suspense/Lazy for ReasonReact.
Stars: ✭ 88 (-9.28%)
Mutual labels:  component
Akane
Lightweight native iOS MVVM framework
Stars: ✭ 92 (-5.15%)
Mutual labels:  component
Ngx Youtube Player
(ngx) A youtube component wrapped with Angular (typescript)
Stars: ✭ 89 (-8.25%)
Mutual labels:  component
React Native Skeleton Content Nonexpo
A customizable skeleton-like loading placeholder for react native projects not using expo.
Stars: ✭ 92 (-5.15%)
Mutual labels:  component
React Swipeable List
Swipeable list component for React.
Stars: ✭ 86 (-11.34%)
Mutual labels:  component
O Grid
Responsive grid system
Stars: ✭ 96 (-1.03%)
Mutual labels:  component
Xmui
基于vue2οΌŒδΈΊε…¬εΈδΊ§ε“ζ‰“(zao)ι€ (lun)ηš„(zi)可倍用UIη»„δ»ΆοΌŒζ–‡ζ‘£:
Stars: ✭ 94 (-3.09%)
Mutual labels:  component
Vue Stepper
πŸ‘¨πŸ»β€πŸš€ A renderless component for composing a Stepper
Stars: ✭ 90 (-7.22%)
Mutual labels:  component
Ngx Select Dropdown
Custom Dropdown for Angular 4+ with multiple and single selection options
Stars: ✭ 91 (-6.19%)
Mutual labels:  component
Talquei
πŸ€– Vue components to build webforms looking like a conversation
Stars: ✭ 90 (-7.22%)
Mutual labels:  component
Ngx Dynamic Form Builder
FormBuilder + class-transformer + class-validator = dynamic form group builder for Angular10+
Stars: ✭ 93 (-4.12%)
Mutual labels:  class
Tyu
Unit test with no initial configuration.
Stars: ✭ 89 (-8.25%)
Mutual labels:  component
React Charts
βš›οΈ Simple, immersive & interactive charts for React
Stars: ✭ 1,302 (+1242.27%)
Mutual labels:  component
Vue Cli Plugin Component
πŸ› οΈ vue-cli 3 plugin to create component
Stars: ✭ 87 (-10.31%)
Mutual labels:  component
Interfacss
The CSS-inspired styling and layout framework for iOS
Stars: ✭ 92 (-5.15%)
Mutual labels:  styling
React Native Sketch View
A React Native component for touch based drawing supporting iOS and Android.
Stars: ✭ 97 (+0%)
Mutual labels:  component
Polyfill
PHP polyfills
Stars: ✭ 1,333 (+1274.23%)
Mutual labels:  component
Polyfill Php54
This component provides functions unavailable in releases prior to PHP 5.4.
Stars: ✭ 93 (-4.12%)
Mutual labels:  component

quark

Quark.js is a microscopic atomic CSS polyfill in 140 bytes

This plugin is the smallest 'atomic' CSS framework, at only 140 bytes it's small enough to fit in a tweet.

What is 'atomic' CSS?

There are a number of CSS frameworks like Tailwind CSS, ACSS, BassCSS, Tachyons, Universal.CSS, and Bootstrap v4 that include pre-made classes for certain properties. These can apply directly to an element in HTML as classes instead of as styles.

How to write classes for Quark

The naming convention Quark uses for writing classes is based on the JavaScript DOM style property names which are similar to their CSS property equivalents. After the property name there is a dash -, and finally we write the value we want. All lengths are in pixels.

For example the following styles:

<div style="color: red; font-size: 20px;"></div>

Could be re-written with Quark classes as:

<div class="color-red fontSize-20"></div>

View the source of index.html to see more!

Adding Quark to your Website

To use Quark, either link to quark.js using a <script> tag like this:

<script src=quark.js></script>

Or embed the entire script inline in the page:

<script>for(t=document.querySelectorAll`*`,i=t.length;i--;)for(s=t[i].classList,c=s.length;c--;)z=s[c].split`-`,u=z[1],t[i].style[z[0]]=~~u?u+'px':u</script>

There's also an ES6 version of the code available in quark-es6.js that can be linked to or included using a <script> tag like this:

<script>[...document.querySelectorAll`*`].map(e=>[...e.classList].map(c=>e.style[[a,b]=c.split`-`,a]=~~b?b+'px':b))</script>

3rd Party Support

Github user @tomhodgins provided a way that Quark classes could be read without the use of quark.js or quark-es6.js using EQCSS in this pen on Codepen: Reading Quark Classes with EQCSS

Documentation

There is an annotated source code file similar (but not identical) to the 140 byte version that explains how the plugin works in an easier-to-read format.

Read Annotated Source

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].