A browserify plugin to load CSS Modules

Related tags

CSS css-modulesify
Overview

css-modulesify

Build Status

A browserify plugin to load CSS Modules.

Please note that this is still highly experimental.

Why CSS Modules?

Normally you need to use a strict naming convention like BEM to ensure that one component's CSS doesn't collide with another's. CSS Modules are locally scoped, which allows you to use names that are meaningful within the context of the component, without any danger of name collision.

Read Mark Dalgleish's excellent "End of Global CSS" and check out css-modules for more context.

Getting started

First install the package: npm install --save css-modulesify

Then you can use it as a browserify plugin, eg: browserify -p [ css-modulesify -o dist/main.css ] example/index.js

Inside example/index.js you can now load css into your scripts. When you do var box1 = require('./box1.css'), box1 will be an object to lookup the localized classname for one of the selectors in that file.

So to apply a class to an element you can do something like:

var styles = require('./styles.css');
var div = `<div class="${styles.inner}">...</div>`;

The generated css will contain locally-scoped versions of any css you have require'd, and will be written out to the file you specify in the --output or -o option.

API Usage

var b = require('browserify')();

b.add('./main.js');
b.plugin(require('css-modulesify'), {
  rootDir: __dirname,
  output: './path/to/my.css'
});

b.bundle();
// or, get the output as a stream
var b = require('browserify')();
var fs = require('fs');

b.add('./main.js');
b.plugin(require('css-modulesify'), {
  rootDir: __dirname
});

var bundle = b.bundle()
b.on('css stream', function (css) {
  css.pipe(fs.createWriteStream('mycss.css'));
});

Options:

  • rootDir: absolute path to your project's root directory. This is optional but providing it will result in better generated classnames. css-modulesify will try to use the browserify basedir if rootDir is not specified, if both are not specified it will use the location from which the command was executed.
  • output: path to write the generated css. If not provided, you'll need to listen to the 'css stream' event on the bundle to get the output.
  • jsonOutput: optional path to write a json manifest of classnames.
  • use: optional array of postcss plugins (by default we use the css-modules core plugins). NOTE: it's safer to use after
  • before: optional array of postcss plugins to run before the required css-modules core plugins are run.
  • after: optional array of postcss plugins to run after the required css-modules core plugins are run.
  • generateScopedName: (API only) a function to override the default behaviour of creating locally scoped classnames.
  • global: optional boolean. Set to true if you want css-modulesify to apply to node_modules as well as local files. You can read more about it in the browserify docs.
  • filePattern: optional regular expression string to specify css file names. (default: \.css$)
  • cache: optional object to persist cache between runs.

Events

  • b.on('css stream', callback) The callback is called with a readable stream containing the compiled CSS. You can write this to a file.

Using CSS Modules on the backend

If you want to use CSS Modules in server-generated templates there are a couple of options:

  • Option A (nodejs only): register the require-hook so that var styles = require('./foo.css') operates the same way as on the frontend. Make sure that the rootDir option matches to guarantee that the classnames are the same.

  • Option B: configure the jsonOutput option with a file path and css-modulesify will generate a JSON manifest of classnames.

PostCSS Plugins

The following PostCSS plugins are enabled by default:

(i.e. the CSS Modules specification).

You can override the default PostCSS Plugins (and add your own) by passing --use|-u to css-modulesify.

Or if you just want to add some extra plugins to run after the default, add them to the postcssAfter array option (API only at this time). In the same way, add extra plugins to postcssBefore to run the before the defaults.

In addition you may also wish to configure defined PostCSS plugins by passing --plugin.option true.

An example of this would be:

browserify -p [css-modulesify \
  --after autoprefixer --autoprefixer.browsers '> 5%' \
  -o dist/main.css] -o dist/index.js src/index.js

Building for production

If you set NODE_ENV=production then css-modulesify will generate shorter (though less useful) classnames.

You can also manually switch to short names by setting the generateScopedName option. Eg:

browserify.plugin(cssModulesify, {
  rootDir: __dirname,
  output: './dist/main.css',
  generateScopedName: cssModulesify.generateShortName
})

Example

An example implementation can be found here.

Licence

MIT

With thanks

  • Tobias Koppers
  • Mark Dalgleish
  • Glen Maddern

Josh Johnston, 2015.

Comments
  • Updates to make watchify work

    Updates to make watchify work

    • using a different kind of tranform that ends the stream correctly
    • inject require statements for composed css modules, so that they are added to browserify's dependency graph
    • clear token cache so that we can rebuild the parts that change
    opened by joshwnj 21
  • Other ways to add postcss plugins

    Other ways to add postcss plugins

    Currently if you use the -u option it overrides all postcss plugins, including the css-modules ones, and you have to manually add them back. I can think of some cases when you'd want to do this but it feels like militant-level modularity :)

    @joshgillies what would you think about a postcssAfter (and possibly postcssBefore) option, which allows you to add postcss plugins to the transformation either side of the default?

    opened by joshwnj 18
  • Destination CSS file is not updating using watchify

    Destination CSS file is not updating using watchify

    Hi guys, working with your example: https://github.com/css-modules/browserify-demo I ran into this problem: using watchify, the event emit 'update' works great but is not updating the dest css file.

    run: npm start and edit a css file from the src folder. The log gets info browserify: /index.js 682ms (bundle) but the dest css file is not changed.

    opened by tinchoz49 13
  • Files with same name can produce same css classes

    Files with same name can produce same css classes

    If you have two files with the same name (e.g. foo.css) both with the same local css class (e.g. .bar) but with different declarations, the resulting css looks something like:

    ._foo__bar {font-weight: bold;}
    ._foo__bar {font-weight: normal;}
    

    What are your thoughts on the best way to handle this?

    opened by mlmorg 10
  • PostCSS Plugins not work

    PostCSS Plugins not work

    i have add postbuild script to mimify/autoprefix my css
    based on README there is possibility add those plugins in "--after" argument - but looks like it don't work or maybe im doing something wrong?

    ...
        "prebuild": "mkdir -p public && cp src/index.html public && browserify -r morearty -r react -r react-dom > public/vendor.js",
        "build": "NODE_ENV=production browserify -p [css-modulesify  --after cssnano -o public/main.css] src/index.coffee --exclude morearty --exclude react --exclude react-dom --extension=.cjsx --extension=.coffee -o public/index.js -v",
        "postbuild": "cssnano ./public/main.css ./public/main.min.css ",
    ...
    

    https://github.com/justgook/sokoban-react

    opened by justgook 9
  • fix #17: add a stream output option

    fix #17: add a stream output option

    The bundle now emits a ’css stream’ event. Users can listen to this and get a stream of the compiled CSS.

    I’m not a super big fan of this API, but I couldn’t think of a better way to give access to the stream.

    fixes #17

    opened by joeybaker 8
  • css-modulesify / autoprefixer postcss version mismatch?

    css-modulesify / autoprefixer postcss version mismatch?

    I got this error while trying to use css-modulesify with autoprefixer: Your current PostCSS version is 4.1.16, but autoprefixer uses 5.0.8. Perhaps this is the source of the error below.

    Not sure if its something wrong with my browserify command incantation, or what.

    Full output below:

    ./node_modules/.bin/browserify -x moment -x react -x react-dom -x tcomb -x whatwg-fetch --debug -p [css-modulesify -o public/css/main.css --after autoprefixer --json app/styles/index.json] index.js | ./no
    de_modules/.bin/exorcist public/js/bundle.js.map > public/js/bundle.js
    Your current PostCSS version is 4.1.16, but autoprefixer uses 5.0.8. Perhaps this is the source of the error below.
    TypeError: css.walkAtRules is not a function while parsing file: [path]/ui/app/components/styles/Progress.css
        at Processor.remove ([path]/ui/node_modules/autoprefixer/lib/processor.js:103:11)
        at plugin ([path]/ui/node_modules/autoprefixer/lib/autoprefixer.js:49:28)
        at LazyResult.run ([path]/ui/node_modules/css-modulesify/node_modules/css-modules-loader-core/node_modules/postcss/lib/lazy-result.js:197:24)
        at [path]/ui/node_modules/css-modulesify/node_modules/css-modules-loader-core/node_modules/postcss/lib/lazy-result.js:110:37
        at LazyResult.asyncTick ([path]/ui/node_modules/css-modulesify/node_modules/css-modules-loader-core/node_modules/postcss/lib/lazy-result.js:124:15)
        at [path]/ui/node_modules/css-modulesify/node_modules/css-modules-loader-core/node_modules/postcss/lib/lazy-result.js:122:27
        at LazyResult.asyncTick ([path]/ui/node_modules/css-modulesify/node_modules/css-modules-loader-core/node_modules/postcss/lib/lazy-result.js:124:15)
        at [path]/ui/node_modules/css-modulesify/node_modules/css-modules-loader-core/node_modules/postcss/lib/lazy-result.js:122:27
        at LazyResult.asyncTick ([path]/ui/node_modules/css-modulesify/node_modules/css-modules-loader-core/node_modules/postcss/lib/lazy-result.js:124:15)
        at [path]/ui/node_modules/css-modulesify/node_modules/css-modules-loader-core/node_modules/postcss/lib/lazy-result.js:122:27
    
    opened by zaim 8
  • error using css files with

    error using css files with "url"

    Hi!! I'm getting an error with css files where i have url tags inside for example:

    .componentOne {
        background-image: url('images/componentOne.jpg');
    }
    

    the error is: loader err [TypeError: Cannot read property 'rewriteUrl' of undefined]

    and i think maybe this pull request is going to fix it: https://github.com/css-modules/postcss-modules-local-by-default/pull/22

    Thanks!! great plugin by the way :+1:

    opened by tinchoz49 8
  • Composition when using :hover etc

    Composition when using :hover etc

    error: composition is only allowed when selector is single :local class name not in ":local(.type-hover):hover". Still new to css modules but this seems odd, is there a more literal "include" which would work in this scenario? I've hit a few cases where this is a blocker, and I have to go expand all the props

    opened by tj 7
  • Don't define transform as global

    Don't define transform as global

    Global transforms run after all other transforms, which means that all other transforms will try to process the CSS file.

    This is bad for many transforms that are like e.g. brfs, which don't check whether the file is valid JS before proceeding to try and parse it (with acorn)

    This patch makes https://github.com/css-modules/browserify-demo/ work

    opened by spion 7
  • Fix race condition

    Fix race condition

    Two things:

    1. Reverting back to browserify's original bundle method. This method is only intended to take a singular argument (a callback in this case).
    2. stream.on('end', function () {}) creates a race condition. Using a callback in the bundle method instead to resolve this.
    opened by tedbreen 6
  • Bump eslint from 1.10.3 to 6.6.0

    Bump eslint from 1.10.3 to 6.6.0

    Bumps eslint from 1.10.3 to 6.6.0.

    Release notes

    Sourced from eslint's releases.

    v6.6.0

    • 39dfe08 Update: false positives in function-call-argument-newline (fixes #12123) (#12280) (Scott O'Hara)
    • 4d84210 Update: improve report location for no-trailing-spaces (fixes #12315) (#12477) (Milos Djermanovic)
    • c6a7745 Update: no-trailing-spaces false negatives after comments (fixes #12479) (#12480) (Milos Djermanovic)
    • 0bffe95 Fix: no-misleading-character-class crash on invalid regex (fixes #12169) (#12347) (Milos Djermanovic)
    • c6a9a3b Update: Add enforceForIndexOf option to use-isnan (fixes #12207) (#12379) (Milos Djermanovic)
    • 364877b Update: measure plugin loading time and output in debug message (#12395) (Victor Homyakov)
    • 1744fab Fix: operator-assignment removes and duplicates comments (#12485) (Milos Djermanovic)
    • 52ca11a Fix: operator-assignment invalid autofix with adjacent tokens (#12483) (Milos Djermanovic)
    • 0f6d0dc Fix: CLIEngine#addPlugin reset lastConfigArrays (fixes #12425) (#12468) (Toru Nagashima)
    • 923a8cb Chore: Fix lint failure in JSDoc comment (#12489) (Brandon Mills)
    • aac3be4 Update: Add ignored prop regex no-param-reassign (#11275) (Luke Bennett)
    • e5382d6 Chore: Remove unused parameter in dot-location (#12464) (Milos Djermanovic)
    • 49faefb Fix: no-obj-calls false positive (fixes #12437) (#12467) (Toru Nagashima)
    • b3dbd96 Fix: problematic installation issue (fixes #11018) (#12309) (Toru Nagashima)
    • cd7c29b Sponsors: Sync README with website (ESLint Jenkins)
    • 8233873 Docs: Add note about Node.js requiring SSL support (fixes #11413) (#12475) (Nicholas C. Zakas)
    • 89e8aaf Fix: improve report location for no-tabs (#12471) (Milos Djermanovic)
    • 7dffe48 Update: Enable function string option in comma-dangle (fixes #12058) (#12462) (YeonJuan)
    • e15e1f9 Docs: fix doc for no-unneeded-ternary rule (fixes #12098) (#12410) (Sam Rae)
    • b1dc58f Sponsors: Sync README with website (ESLint Jenkins)
    • 61749c9 Chore: Provide debug log for parser errors (#12474) (Brad Zacher)
    • 7c8bbe0 Update: enforceForOrderingRelations no-unsafe-negation (fixes #12163) (#12414) (Sam Rae)
    • 349ed67 Update: improve report location for no-mixed-operators (#12328) (Chiawen Chen)
    • a102eaa Fix: prefer-numeric-literals invalid autofix with adjacent tokens (#12387) (Milos Djermanovic)
    • 6e7c18d Update: enforceForNewInMemberExpressions no-extra-parens (fixes #12428) (#12436) (Milos Djermanovic)
    • 51fbbd7 Fix: array-bracket-newline consistent error with comments (fixes #12416) (#12441) (Milos Djermanovic)
    • e657d4c Fix: report full dot location in dot-location (#12452) (Milos Djermanovic)
    • 2d6e345 Update: make isSpaceBetweenTokens() ignore newline in comments (#12407) (YeonJuan)
    • 84f71de Update: remove default overrides in keyword-spacing (fixes #12369) (#12411) (YeonJuan)
    • 18a0b0e Update: improve report location for no-space-in-parens (#12364) (Chiawen Chen)
    • d61c8a5 Update: improve report location for no-multi-spaces (#12329) (Chiawen Chen)
    • 561093f Upgrade: bump inquirer to ^7.0.0 (#12440) (Joe Graham)
    • fb633b2 Chore: Add a script for testing with more control (#12444) (Eric Wang)
    • 012ec51 Sponsors: Sync README with website (ESLint Jenkins)
    • 874fe16 New: pass cwd from cli engine (#12389) (Eric Wang)
    • b962775 Update: no-self-assign should detect member expression with this (#12279) (Tibor Blenessy)
    • 02977f2 Docs: Clarify eslint:recommended semver policy (#12429) (Kevin Partington)
    • 97045ae Docs: Fixes object type for rules in "Use a Plugin" (#12409) (Daisy Develops)
    • 24ca088 Docs: Fix typo in v6 migration guide (#12412) (Benjamim Sonntag)
    • b094008 Chore: update version parameter name (#12402) (Toru Nagashima)
    • e5637ba Chore: enable jsdoc/require-description (#12365) (Kai Cataldo)
    • d31f337 Sponsors: Sync README with website (ESLint Jenkins)
    • 7ffb22f Chore: Clean up inline directive parsing (#12375) (Jordan Eldredge)
    • 84467c0 Docs: fix wrong max-depth example (fixes #11991) (#12358) (Gabriel R Sezefredo)
    • 3642342 Docs: Fix minor formatting/grammar errors (#12371) (cherryblossom000)
    • c47fa0d Docs: Fix missing word in sentence (#12361) (Dan Boulet)
    • 8108f49 Chore: enable additional eslint-plugin-jsdoc rules (#12336) (Kai Cataldo)
    • b718d2e Chore: update issue template with --eslint-fix flag (#12352) (James George)
    • 20ba14d Sponsors: Sync README with website (ESLint Jenkins)
    ... (truncated)
    Changelog

    Sourced from eslint's changelog.

    v6.6.0 - October 25, 2019

    • 39dfe08 Update: false positives in function-call-argument-newline (fixes #12123) (#12280) (Scott O'Hara)
    • 4d84210 Update: improve report location for no-trailing-spaces (fixes #12315) (#12477) (Milos Djermanovic)
    • c6a7745 Update: no-trailing-spaces false negatives after comments (fixes #12479) (#12480) (Milos Djermanovic)
    • 0bffe95 Fix: no-misleading-character-class crash on invalid regex (fixes #12169) (#12347) (Milos Djermanovic)
    • c6a9a3b Update: Add enforceForIndexOf option to use-isnan (fixes #12207) (#12379) (Milos Djermanovic)
    • 364877b Update: measure plugin loading time and output in debug message (#12395) (Victor Homyakov)
    • 1744fab Fix: operator-assignment removes and duplicates comments (#12485) (Milos Djermanovic)
    • 52ca11a Fix: operator-assignment invalid autofix with adjacent tokens (#12483) (Milos Djermanovic)
    • 0f6d0dc Fix: CLIEngine#addPlugin reset lastConfigArrays (fixes #12425) (#12468) (Toru Nagashima)
    • 923a8cb Chore: Fix lint failure in JSDoc comment (#12489) (Brandon Mills)
    • aac3be4 Update: Add ignored prop regex no-param-reassign (#11275) (Luke Bennett)
    • e5382d6 Chore: Remove unused parameter in dot-location (#12464) (Milos Djermanovic)
    • 49faefb Fix: no-obj-calls false positive (fixes #12437) (#12467) (Toru Nagashima)
    • b3dbd96 Fix: problematic installation issue (fixes #11018) (#12309) (Toru Nagashima)
    • cd7c29b Sponsors: Sync README with website (ESLint Jenkins)
    • 8233873 Docs: Add note about Node.js requiring SSL support (fixes #11413) (#12475) (Nicholas C. Zakas)
    • 89e8aaf Fix: improve report location for no-tabs (#12471) (Milos Djermanovic)
    • 7dffe48 Update: Enable function string option in comma-dangle (fixes #12058) (#12462) (YeonJuan)
    • e15e1f9 Docs: fix doc for no-unneeded-ternary rule (fixes #12098) (#12410) (Sam Rae)
    • b1dc58f Sponsors: Sync README with website (ESLint Jenkins)
    • 61749c9 Chore: Provide debug log for parser errors (#12474) (Brad Zacher)
    • 7c8bbe0 Update: enforceForOrderingRelations no-unsafe-negation (fixes #12163) (#12414) (Sam Rae)
    • 349ed67 Update: improve report location for no-mixed-operators (#12328) (Chiawen Chen)
    • a102eaa Fix: prefer-numeric-literals invalid autofix with adjacent tokens (#12387) (Milos Djermanovic)
    • 6e7c18d Update: enforceForNewInMemberExpressions no-extra-parens (fixes #12428) (#12436) (Milos Djermanovic)
    • 51fbbd7 Fix: array-bracket-newline consistent error with comments (fixes #12416) (#12441) (Milos Djermanovic)
    • e657d4c Fix: report full dot location in dot-location (#12452) (Milos Djermanovic)
    • 2d6e345 Update: make isSpaceBetweenTokens() ignore newline in comments (#12407) (YeonJuan)
    • 84f71de Update: remove default overrides in keyword-spacing (fixes #12369) (#12411) (YeonJuan)
    • 18a0b0e Update: improve report location for no-space-in-parens (#12364) (Chiawen Chen)
    • d61c8a5 Update: improve report location for no-multi-spaces (#12329) (Chiawen Chen)
    • 561093f Upgrade: bump inquirer to ^7.0.0 (#12440) (Joe Graham)
    • fb633b2 Chore: Add a script for testing with more control (#12444) (Eric Wang)
    • 012ec51 Sponsors: Sync README with website (ESLint Jenkins)
    • 874fe16 New: pass cwd from cli engine (#12389) (Eric Wang)
    • b962775 Update: no-self-assign should detect member expression with this (#12279) (Tibor Blenessy)
    • 02977f2 Docs: Clarify eslint:recommended semver policy (#12429) (Kevin Partington)
    • 97045ae Docs: Fixes object type for rules in "Use a Plugin" (#12409) (Daisy Develops)
    • 24ca088 Docs: Fix typo in v6 migration guide (#12412) (Benjamim Sonntag)
    • b094008 Chore: update version parameter name (#12402) (Toru Nagashima)
    • e5637ba Chore: enable jsdoc/require-description (#12365) (Kai Cataldo)
    • d31f337 Sponsors: Sync README with website (ESLint Jenkins)
    • 7ffb22f Chore: Clean up inline directive parsing (#12375) (Jordan Eldredge)
    • 84467c0 Docs: fix wrong max-depth example (fixes #11991) (#12358) (Gabriel R Sezefredo)
    • 3642342 Docs: Fix minor formatting/grammar errors (#12371) (cherryblossom000)
    • c47fa0d Docs: Fix missing word in sentence (#12361) (Dan Boulet)
    • 8108f49 Chore: enable additional eslint-plugin-jsdoc rules (#12336) (Kai Cataldo)
    • b718d2e Chore: update issue template with --eslint-fix flag (#12352) (James George)
    ... (truncated)
    Commits
    • 879c373 6.6.0
    • c8ba30a Build: changelog update for 6.6.0
    • 39dfe08 Update: false positives in function-call-argument-newline (fixes #12123) (#12...
    • 4d84210 Update: improve report location for no-trailing-spaces (fixes #12315) (#12477)
    • c6a7745 Update: no-trailing-spaces false negatives after comments (fixes #12479) (#12...
    • 0bffe95 Fix: no-misleading-character-class crash on invalid regex (fixes #12169) (#12...
    • c6a9a3b Update: Add enforceForIndexOf option to use-isnan (fixes #12207) (#12379)
    • 364877b Update: measure plugin loading time and output in debug message (#12395)
    • 1744fab Fix: operator-assignment removes and duplicates comments (#12485)
    • 52ca11a Fix: operator-assignment invalid autofix with adjacent tokens (#12483)
    • Additional commits viewable in compare view
    Maintainer changes

    This version was pushed to npm by eslintbot, a new releaser for eslint since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Access to result of postcss

    Access to result of postcss

    is there possibility to access to result of postcss plugins?

    I'm using postcss-import plugin and need to watch(watchify) every file imported by @import call in css.

    Example below, but with css-modulesify don't know how to do it.

       Postcss().use(p).process(data).then((result) => {
          for ( const msg of result.messages ) {
            if ( msg.type != "dependency" ) continue;
            b.emit("file", msg.file); //watchify
          }
        });
    
    opened by Kamil93 0
  • Sort output by filename for more determinism.

    Sort output by filename for more determinism.

    Currently the order seems arbitrary, resulting in a non-reproducable build output. Note this only addresses one source of non-determinism, there may be more.

    In case it looks dangerous to you, notice that this only sorts the roots of the dependency graph, so it does not introduce out-of-order dependencies.

    opened by Treora 0
  • Loading CSS modules from a different root

    Loading CSS modules from a different root

    I use CSS modules with TypeScript (with https://github.com/Quramy/typed-css-modules). TypeScript modules are transpiled to separate directory (dist/tsc). This does not copy CSS modules to that directory so when I try to run browserify with css-modulesify plugin (rootDir option is dist/tsc) I get Cannot find module error.

    Of course, if I copy CSS modules to dist/tsc before running broweserify then it works fine but it would be nice to omit this step to make build faster.

    opened by mxl 0
Owner
null
A set of small, responsive CSS modules that you can use in every web project.

Pure A set of small, responsive CSS modules that you can use in every web project. http://purecss.io/ This project is looking for maintainers to suppo

Pure CSS 22.7k Jan 3, 2023
Reseter.css - A Futuristic CSS Reset / CSS Normalizer

Reseter.css A CSS Reset/Normalizer Reseter.css is an awesome CSS reset for a website. It is a great tool for any web designer. Reseter.css resets all

Krish Dev DB 1.1k Jan 2, 2023
Spectre.css - A Lightweight, Responsive and Modern CSS Framework

Spectre.css Spectre.css is a lightweight, responsive and modern CSS framework. Lightweight (~10KB gzipped) starting point for your projects Flexbox-ba

Yan Zhu 11.1k Jan 8, 2023
Low-level CSS Toolkit – the original Functional/Utility/Atomic CSS library

Basscss Low-level CSS toolkit – the original Functional CSS library https://basscss.com Lightning-Fast Modular CSS with No Side Effects Basscss is a l

Basscss 5.8k Dec 31, 2022
Framework-agnostic CSS-in-JS with support for server-side rendering, browser prefixing, and minimum CSS generation

Aphrodite Framework-agnostic CSS-in-JS with support for server-side rendering, browser prefixing, and minimum CSS generation. Support for colocating y

Khan Academy 5.3k Jan 1, 2023
CSS Boilerplate / Starter Kit: Collection of best-practice CSS selectors

Natural Selection Natural Selection is a CSS framework without any styling at all. It is just a collection of selectors that can be used to define glo

FrontAid CMS 104 Dec 8, 2022
Source code for Chrome/Edge/Firefox/Opera extension Magic CSS (Live editor for CSS, Less & Sass)

Live editor for CSS, Less & Sass (Magic CSS) Extension Live editor for CSS, Less & Sass (Magic CSS) for Google Chrome, Microsoft Edge, Mozilla Firefox

null 210 Dec 13, 2022
Easily create css variables without the need for a css file!

Tailwind CSS Variables This plugin allows you to configure CSS variables in the tailwind.config.js Similar to the tailwindcss configurations you are u

Mert Aşan 111 Dec 22, 2022
Cooltipz.css - A highly customisable, minimal, pure CSS tooltip library

Cooltipz.css - Cool tooltips Cool customisable tooltips made from pure CSS Lightweight • Accessible • Customisable • Simple Cooltipz.css is a pure CSS

Jack Domleo 110 Dec 24, 2022
micro-library for CSS Flexbox and CSS Grid

SpeedGrid micro-library for CSS Flexbox and CSS Grid Overview SpeedGrid dynamically generates inline CSS by specifying the class name. Easy maintenanc

Toshihide Miyake 7 Mar 26, 2022
Data-tip.css - Wow, such tooltip, with pure css!

Notice: hint.css has been much better since I complained about it months ago, so try out its new features instead of this one! data-tip.css Wow, such

EGOIST 117 May 26, 2021
Tiny CSS framework with almost no classes and some pure CSS effects

no.css INTERACTIVE DEMO I am tired of adding classes to style my HTML. I just want to include a .css file and I expect it to style the HTML for me. no

null 96 Dec 10, 2022
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

Bootstrap Sleek, intuitive, and powerful front-end framework for faster and easier web development. Explore Bootstrap docs » Report bug · Request feat

Bootstrap 161k Jan 1, 2023
Modern CSS framework based on Flexbox

Bulma Bulma is a modern CSS framework based on Flexbox. Quick install Bulma is constantly in development! Try it out now: NPM npm install bulma or Yar

Jeremy Thomas 46.6k Dec 31, 2022
A utility-first CSS framework for rapid UI development.

A utility-first CSS framework for rapidly building custom user interfaces. Documentation For full documentation, visit tailwindcss.com. Community For

Tailwind Labs 63.5k Dec 30, 2022
Materialize, a CSS Framework based on Material Design

MaterializeCSS Materialize, a CSS Framework based on material design. -- Browse the docs -- Table of Contents Quickstart Documentation Supported Brows

Alvin Wang 38.8k Jan 2, 2023
Material Design Components in HTML/CSS/JS

Material Design Lite An implementation of Material Design components in vanilla CSS, JS, and HTML. Material Design Lite (MDL) lets you add a Material

Google 32.1k Jan 4, 2023
Functional css for humans

TACHYONS Functional CSS for humans. Quickly build and design new UI without writing CSS. Principles Everything should be 100% responsive Everything sh

null 11.3k Jan 4, 2023
The CSS design system that powers GitHub

Primer CSS The CSS implementation of GitHub's Primer Design System Migrating ?? If you currently use the primer or primer--prefixed npm packages, plea

Primer 11.6k Jan 3, 2023