Description
css in your javascript
usage
glamor alternatives and similar libraries
Based on the "PostCSS" category.
Alternatively, view glamor alternatives based on common mentions on social networks and blogs.
-
styled-components
Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress ๐ -
CSS Layout
A collection of popular layouts and patterns made with CSS. Now it has 100+ patterns and continues growing! -
Aphrodite
Framework-agnostic CSS-in-JS with support for server-side rendering, browser prefixing, and minimum CSS generation -
vue-virtual-scroll-list
โก๏ธA vue component support big amount data list with high render performance and efficient. -
jTools - Javascript web components
jSuites is a collection of lightweight common required javascript web components. It is composed of fully responsive vanilla plugins to help you bring the best user experience to your projects, independent of the platform. Same JS codebase across different platforms. -
React Inline
DISCONTINUED. Transform inline styles defined in JavaScript modules into static CSS code and class names so they become available to, e.g. the `className` prop of React elements. -
File Management with Preview
DISCONTINUED. A file management system built with Vue.js and TypeScript that allows for single and multiple file uploading with a preview feature -
A Vue 3 Dynamic and Versatile High Performance Infinite Scroller Component
A Vue 3 Dynamic and Versatile High Performance Infinite Scroller Component
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of glamor or a related project?
README
glamor
css in your javascript
npm install glamor --save
usage
import { css } from 'glamor'
// make css rules
let rule = css({
color: 'red',
':hover': {
color: 'pink'
},
'@media(min-width: 300px)': {
color: 'green',
':hover': {
color: 'yellow'
}
}
})
// add as data attributes
<div {...rule} {...another}>
zomg
</div>
// or as classes
<div className={`${rule} ${another}`}>
zomg
</div>
// merge rules for great justice
let mono = css({
fontFamily: 'monospace'
})
let bolder = css({
fontWeight: 'bolder'
})
<div {...css(mono, bolder)}>
bold code!
</div>
motivation
This expands on ideas from @vjeux's 2014 css-in-js talk. We introduce an api to annotate arbitrary dom nodes with style definitions ("rules") for, um, the greater good.
features
- fast / efficient, with a fluent api
- framework independent
- adds vendor prefixes / fallback values
- supports all the pseudo :classes/::elements
@media
queries@supports
statements@font-face
/@keyframes
- escape hatches for parent / child / contextual selectors
- dev helper to simulate pseudo classes like
:hover
, etc - server side / static rendering
- tests / coverage
- experimental - write real css, with syntax highlighting and linting
(thanks to BrowserStack for providing the infrastructure that allows us to run our build in real browsers.)
docs
- api documentation
- howto - a comparison of css techniques in glamor
- plugins
- server side rendering
- performance tips
- what happens when I call css(...rules)?
extras
glamor/reset
- include a css reset- use a
css
prop on all your react elements glamor/react
- helpers for themes,@vars
glamor/jsxstyle
- react integration, ร la jsxstyleglamor/aphrodite
- shim for aphrodite stylesheetsglamor/utils
- a port of postcss-utilitiesglamor/ous
- a port of the skeleton css frameworkglamor/styled
- an experimental port of styled-components
speedy mode
there are two methods by which the library adds styles to the document -
- by appending css 'rules' to a browser backed stylesheet. This is really fast, but has the disadvantage of making the styles uneditable in the devtools sidebar.
- by appending text nodes to a style tag. This is fairly slow, but doesn't have the editing drawback.
as a compromise, we enable the former 'speedy' mode NODE_ENV=production
, and disable it otherwise. You can manually toggle this with the speedy()
function.
characteristics
while glamor shares most common attributes of other inline style / css-in-js systems, here are some key differences -
- uses 'real' stylesheets, so you can use all css features.
- rules can be used as data-attributes or classNames.
- simulate pseudo-classes with the
simulate
helper. very useful, especially when combined when hot-loading and/or editing directly in devtools. - really fast, by way of deduping rules, and using insertRule in production.
todo
- redo all the docs
- planned enhancements
- notes on composition
profit, profit
I get it