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.
106
132
+ 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

30.9K
22.2K
3K
Syntactically Awesome Style Sheets
30.9K
22.2K
+ 1
3K
PROS OF SASS
  • 608
    Variables
  • 593
    Mixins
  • 467
    Nested rules
  • 411
    Maintainable
  • 299
    Functions
  • 150
    Modular flexible code
  • 141
    Open source
  • 112
    Selector inheritance
  • 107
    Dynamic
  • 96
    Better than cs
  • 4
    Used by Bootstrap
  • 2
    If and for function
  • 1
    Better than less
  • 1
    Inheritance (@extend)
  • 1
    Custom functions
CONS OF SASS
  • 1
    Needs to be compiled

related Sass posts

Islam Diab
Full-stack Developer at Freelancer | 9 upvotes 路 25.4K views

Hi, I want to start freelancing, I have two years of experience in web development, and my skills in web development: HTML CSS JavaScript [basic, Object-Oriented Programming, Document object model, and browser object model] jQuery Bootstrap 3, 4 Pre-processor -> Sass Template Engine with Pug.js Task Runner with Gulp.js and Webpack Ajax JSON JavaScript Unit testing with jest framework Vue.js

Node.js [Just basic]

My Skills in Back end development Php [Basic, and Object-Oriented Programming] Database management system with MySql for database relationships and MongoDB for database non-relationships architecture pattern with MVC concept concept of SOLID Unit testing with PHPUnit Restful API

Laravel Framework

and version control with GitHub ultimately, I want to start working as a freelancer full time. Thanks.

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
Radium logo

Radium

17
33
0
A toolchain for React component styling
17
33
+ 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

      103
      79
      0
      It is a methodology, that helps you to achieve reusable components and code sharing in the front-end
      103
      79
      + 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

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

                related styled-components posts

                Johnny Bell

                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

                199
                190
                3
                The Next Generation of CSS in JS
                199
                190
                + 1
                3
                PROS OF EMOTION
                • 3
                  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

                  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

                  9.2K
                  1.4K
                  0
                  A library of CSS animations
                  9.2K
                  1.4K
                  + 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

                      2K
                      1.1K
                      931
                      The dynamic stylesheet language
                      2K
                      1.1K
                      + 1
                      931
                      PROS OF LESS
                      • 215
                        Better than css
                      • 177
                        Variables
                      • 141
                        Mixins
                      • 99
                        Maintainable
                      • 79
                        Used by bootstrap
                      • 56
                        Open source
                      • 51
                        Extendable
                      • 43
                        Functions
                      • 39
                        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 路 85.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