Alternatives to CSS Modules logo

Alternatives to CSS Modules

Sass, Radium, BEM, CSS Blocks, and styled-components are the most popular alternatives and competitors to CSS Modules.
88
111
+ 1
1

What is CSS Modules and what are its top alternatives?

It is a CSS file in which all class names and animation names are scoped locally by default. The key words here are scoped locally. With this, your CSS class names become similar to local variables in JavaScript. It goes into the compiler, and CSS comes out the other side.
CSS Modules is a tool in the CSS Pre-processors / Extensions category of a tech stack.

Top Alternatives to CSS Modules

  • Sass

    Sass

    Sass is an extension of CSS3, adding nested rules, variables, mixins, selector inheritance, and more. It's translated to well-formatted, standard CSS using the command line tool or a web-framework plugin. ...

  • Radium

    Radium

    Radium is a set of tools to manage inline styles on React elements. It gives you powerful styling capabilities without CSS. ...

  • BEM

    BEM

    This methodology was developed at Yandex with the goals in mind that Fast development and long-lasting results for standard projects,A project involves many people,Scalable teams,Code reuse. ...

  • CSS Blocks

    CSS Blocks

    By combining an opinionated authoring system, build-time analysis and rewriting of templates, and a new type of CSS optimizer, css-blocks breathes new power and ease of use into the technologies and best practices that stylesheet developers already know and love. ...

  • styled-components

    styled-components

    Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 馃拝 ...

  • Emotion

    Emotion

    Emotion is a performant and flexible CSS-in-JS library. Building on many other CSS-in-JS libraries, it allows you to style apps quickly with string or object styles. It has predictable composition to avoid specificity issues with CSS. With source maps and labels, Emotion has a great developer experience and great performance with heavy caching in production. ...

  • Animate.css

    Animate.css

    It is a bunch of cool, fun, and cross-browser animations for you to use in your projects. Great for emphasis, home pages, sliders, and general just-add-water-awesomeness. ...

  • Less

    Less

    Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable and extendable. ...

CSS Modules alternatives & related posts

Sass logo

Sass

25K
17.2K
3K
Syntactically Awesome Style Sheets
25K
17.2K
+ 1
3K
PROS OF SASS
  • 603
    Variables
  • 586
    Mixins
  • 464
    Nested rules
  • 411
    Maintainable
  • 296
    Functions
  • 148
    Modular flexible code
  • 140
    Open source
  • 110
    Selector inheritance
  • 106
    Dynamic
  • 95
    Better than cs
  • 3
    Used by Bootstrap
  • 2
    If and for function
  • 1
    Custom functions
  • 1
    Better than less
CONS OF SASS
    Be the first to leave a con

    related Sass posts

    ReactQL is a React + GraphQL front-end starter kit. #JSX is a natural way to think about building UI, and it renders to pure #HTML in the browser and on the server, making it trivial to build server-rendered Single Page Apps. GraphQL via Apollo was chosen for the data layer; #GraphQL makes it simple to request just the data your app needs, and #Apollo takes care of communicating with your API (written in any language; doesn't have to be JavaScript!), caching, and rendering to #React.

    ReactQL is written in TypeScript to provide full types/Intellisense, and pick up hard-to-diagnose goofs that might later show up at runtime. React makes heavy use of Webpack 4 to handle transforming your code to an optimised client-side bundle, and in throws back just enough code needed for the initial render, while seamlessly handling import statements asynchronously as needed, making the payload your user downloads ultimately much smaller than trying to do it by hand.

    React Helmet was chosen to handle <head> content, because it works universally, making it easy to throw back the correct <title> and other tags on the initial render, as well as inject new tags for subsequent client-side views.

    styled-components, Sass, Less and PostCSS were added to give developers a choice of whether to build styles purely in React / JavaScript, or whether to defer to a #css #preprocessor. This is especially useful for interop with UI frameworks like Bootstrap, Semantic UI, Foundation, etc - ReactQL lets you mix and match #css and renders to both a static .css file during bundling as well as generates per-page <style> tags when using #StyledComponents.

    React Router handles routing, because it works both on the server and in the client. ReactQL customises it further by capturing non-200 responses on the server, redirecting or throwing back custom 404 pages as needed.

    Koa is the web server that handles all incoming HTTP requests, because it's fast (TTFB < 5ms, even after fully rendering React), and its natively #async, making it easy to async/await inside routes and middleware.

    See more
    Julien DeFrance
    Principal Software Engineer at Tophatter | 6 upvotes 路 67.7K views
    Shared insights
    on
    BootstrapBootstrapLessLessSassSass
    at

    Which #GridFramework to use? My team and I closed on Bootstrap !

    On a related note and as far as stylesheets go, we had to chose between #CSS, #SCSS, #Sass , Less Finally opted for Sass

    As syntactically awesome as the name announces it.

    See more
    Radium logo

    Radium

    16
    31
    0
    A toolchain for React component styling
    16
    31
    + 1
    0
    PROS OF RADIUM
      Be the first to leave a pro
      CONS OF RADIUM
        Be the first to leave a con

        related Radium posts

        BEM logo

        BEM

        84
        64
        0
        It is a methodology, that helps you to achieve reusable components and code sharing in the front-end
        84
        64
        + 1
        0
        PROS OF BEM
          Be the first to leave a pro
          CONS OF BEM
            Be the first to leave a con

            related BEM posts

            CSS Blocks logo

            CSS Blocks

            26
            34
            0
            A component-oriented CSS authoring system by LinkedIn
            26
            34
            + 1
            0
            PROS OF CSS BLOCKS
              Be the first to leave a pro
              CONS OF CSS BLOCKS
                Be the first to leave a con

                related CSS Blocks posts

                styled-components logo

                styled-components

                737
                392
                7
                Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps...
                737
                392
                + 1
                7
                PROS OF STYLED-COMPONENTS
                • 7
                  Very easy to use and integrate
                CONS OF STYLED-COMPONENTS
                  Be the first to leave a con

                  related styled-components posts

                  Johnny Bell
                  Software Engineer at Weedmaps | 14 upvotes 路 452.7K views

                  For Stack Decisions I needed to add Markdown in the decision composer to give our users access to some general styling when writing their decisions. We used React & GraphQL on the #Frontend and Ruby & GraphQL on the backend.

                  Instead of using Showdown or another tool, We decided to parse the Markdown on the backend so we had more control over what we wanted to render in Markdown because we didn't want to enable all Markdown options, we also wanted to limit any malicious code or images to be embedded into the decisions and Markdown was a fairly large to import into our component so it was going to add a lot of kilobytes that we didn't need.

                  We also needed to style how the markdown looked, we are currently using Glamorous so I used that but we are planning to update this to Emotion at some stage as it has a fairly easy upgrade path rather than switching over to styled-components or one of the other cssInJs alternatives.

                  Also we used React-Mentions for tagging tools and topics in the decisions. Typing @ will let you tag a tool, and typing # will allow you to tag a topic.

                  The Markdown options that we chose to support are tags: a, code, u, b, em, pre, ul, ol, li.

                  If there are anymore tags you'd love to see added in the composer leave me a comment below and we will look into adding them.

                  #StackDecisionsLaunch

                  See more

                  ReactQL is a React + GraphQL front-end starter kit. #JSX is a natural way to think about building UI, and it renders to pure #HTML in the browser and on the server, making it trivial to build server-rendered Single Page Apps. GraphQL via Apollo was chosen for the data layer; #GraphQL makes it simple to request just the data your app needs, and #Apollo takes care of communicating with your API (written in any language; doesn't have to be JavaScript!), caching, and rendering to #React.

                  ReactQL is written in TypeScript to provide full types/Intellisense, and pick up hard-to-diagnose goofs that might later show up at runtime. React makes heavy use of Webpack 4 to handle transforming your code to an optimised client-side bundle, and in throws back just enough code needed for the initial render, while seamlessly handling import statements asynchronously as needed, making the payload your user downloads ultimately much smaller than trying to do it by hand.

                  React Helmet was chosen to handle <head> content, because it works universally, making it easy to throw back the correct <title> and other tags on the initial render, as well as inject new tags for subsequent client-side views.

                  styled-components, Sass, Less and PostCSS were added to give developers a choice of whether to build styles purely in React / JavaScript, or whether to defer to a #css #preprocessor. This is especially useful for interop with UI frameworks like Bootstrap, Semantic UI, Foundation, etc - ReactQL lets you mix and match #css and renders to both a static .css file during bundling as well as generates per-page <style> tags when using #StyledComponents.

                  React Router handles routing, because it works both on the server and in the client. ReactQL customises it further by capturing non-200 responses on the server, redirecting or throwing back custom 404 pages as needed.

                  Koa is the web server that handles all incoming HTTP requests, because it's fast (TTFB < 5ms, even after fully rendering React), and its natively #async, making it easy to async/await inside routes and middleware.

                  See more
                  Emotion logo

                  Emotion

                  152
                  161
                  2
                  The Next Generation of CSS in JS
                  152
                  161
                  + 1
                  2
                  PROS OF EMOTION
                  • 2
                    Easy to use
                  CONS OF EMOTION
                    Be the first to leave a con

                    related Emotion posts

                    Robert Zuber

                    We are in the process of adopting Next.js as our React framework and using Storybook to help build our React components in isolation. This new part of our frontend is written in TypeScript, and we use Emotion for CSS/styling. For delivering data, we use GraphQL and Apollo. Jest, Percy, and Cypress are used for testing.

                    See more
                    Johnny Bell
                    Software Engineer at Weedmaps | 14 upvotes 路 452.7K views

                    For Stack Decisions I needed to add Markdown in the decision composer to give our users access to some general styling when writing their decisions. We used React & GraphQL on the #Frontend and Ruby & GraphQL on the backend.

                    Instead of using Showdown or another tool, We decided to parse the Markdown on the backend so we had more control over what we wanted to render in Markdown because we didn't want to enable all Markdown options, we also wanted to limit any malicious code or images to be embedded into the decisions and Markdown was a fairly large to import into our component so it was going to add a lot of kilobytes that we didn't need.

                    We also needed to style how the markdown looked, we are currently using Glamorous so I used that but we are planning to update this to Emotion at some stage as it has a fairly easy upgrade path rather than switching over to styled-components or one of the other cssInJs alternatives.

                    Also we used React-Mentions for tagging tools and topics in the decisions. Typing @ will let you tag a tool, and typing # will allow you to tag a topic.

                    The Markdown options that we chose to support are tags: a, code, u, b, em, pre, ul, ol, li.

                    If there are anymore tags you'd love to see added in the composer leave me a comment below and we will look into adding them.

                    #StackDecisionsLaunch

                    See more
                    Animate.css  logo

                    Animate.css

                    8.7K
                    985
                    0
                    A library of CSS animations
                    8.7K
                    985
                    + 1
                    0
                    PROS OF ANIMATE.CSS
                      Be the first to leave a pro
                      CONS OF ANIMATE.CSS
                        Be the first to leave a con

                        related Animate.css posts

                        Less logo

                        Less

                        1.8K
                        1.1K
                        926
                        The dynamic stylesheet language
                        1.8K
                        1.1K
                        + 1
                        926
                        PROS OF LESS
                        • 214
                          Better than css
                        • 176
                          Variables
                        • 140
                          Mixins
                        • 99
                          Maintainable
                        • 79
                          Used by bootstrap
                        • 56
                          Open source
                        • 51
                          Extendable
                        • 42
                          Functions
                        • 38
                          Dynamic
                        • 30
                          Fast
                        • 1
                          CSS is valid LESS, very easy to pick up
                        CONS OF LESS
                          Be the first to leave a con

                          related Less posts

                          ReactQL is a React + GraphQL front-end starter kit. #JSX is a natural way to think about building UI, and it renders to pure #HTML in the browser and on the server, making it trivial to build server-rendered Single Page Apps. GraphQL via Apollo was chosen for the data layer; #GraphQL makes it simple to request just the data your app needs, and #Apollo takes care of communicating with your API (written in any language; doesn't have to be JavaScript!), caching, and rendering to #React.

                          ReactQL is written in TypeScript to provide full types/Intellisense, and pick up hard-to-diagnose goofs that might later show up at runtime. React makes heavy use of Webpack 4 to handle transforming your code to an optimised client-side bundle, and in throws back just enough code needed for the initial render, while seamlessly handling import statements asynchronously as needed, making the payload your user downloads ultimately much smaller than trying to do it by hand.

                          React Helmet was chosen to handle <head> content, because it works universally, making it easy to throw back the correct <title> and other tags on the initial render, as well as inject new tags for subsequent client-side views.

                          styled-components, Sass, Less and PostCSS were added to give developers a choice of whether to build styles purely in React / JavaScript, or whether to defer to a #css #preprocessor. This is especially useful for interop with UI frameworks like Bootstrap, Semantic UI, Foundation, etc - ReactQL lets you mix and match #css and renders to both a static .css file during bundling as well as generates per-page <style> tags when using #StyledComponents.

                          React Router handles routing, because it works both on the server and in the client. ReactQL customises it further by capturing non-200 responses on the server, redirecting or throwing back custom 404 pages as needed.

                          Koa is the web server that handles all incoming HTTP requests, because it's fast (TTFB < 5ms, even after fully rendering React), and its natively #async, making it easy to async/await inside routes and middleware.

                          See more
                          Julien DeFrance
                          Principal Software Engineer at Tophatter | 6 upvotes 路 67.7K views
                          Shared insights
                          on
                          BootstrapBootstrapLessLessSassSass
                          at

                          Which #GridFramework to use? My team and I closed on Bootstrap !

                          On a related note and as far as stylesheets go, we had to chose between #CSS, #SCSS, #Sass , Less Finally opted for Sass

                          As syntactically awesome as the name announces it.

                          See more