babel-plugin-macros
vanilla-extract

babel-plugin-macros | vanilla-extract | |
---|---|---|
6 | 97 | |
2,636 | 9,966 | |
0.0% | 0.4% | |
0.0 | 8.5 | |
about 2 years ago | 9 days ago | |
JavaScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
babel-plugin-macros
-
Fixing Class Composition in Tailwind CSS
One of the more promising alternatives is twin.macro - a Babel macro that processes Tailwind classes to generate JS objects understandable by various CSS-in-JS libraries. The developer experience (DX) of using it is amazing as you not only get all of Tailwindās features without much change to your code, but you also get much more flexibility - all that on top of the traditional benefits of CSS-in-JS. Hereās an example code:
-
[AskJS] My approach to Application Config, what does the JS community think of this?
For example with Babel you could use babel-plugin-macros to execute this file at compile time and replace the file contents with the result of the computation. So appSettings would only have the configs for the current environment and nothing more and your source wouldn't need to change much.
-
I made a package to help you with file-system based routing for react-router-dom
It does require babel-plugin-macros which should also help with keeping things nice and performant in production. The package is part of a larger initiative im trying to achieve which is to create file-system based routing for all mainstream React and React Native routing packages. I have done everything I can to keep it as boilerplate free as I can. To give an example
-
Jest Error in a NextJS project. babel-jest is unable to find my babel.config.js
MacroError: The macro you imported from "undefined" is being executed outside the context of compilation with babel-plugin-macros. This indicates that you don't have the babel plugin "babel-plugin-macros" configured correctly. Please see the documentation for how to configure babel-plugin-macros properly: https://github.com/kentcdodds/babel-plugin-macros/blob/master/other/docs/user.md
-
I am creating a pattern-matching plugin in javascript. This is what it does. Are you interested in using it?
Yes, it also does that. https://github.com/kentcdodds/babel-plugin-macros
-
A tale of knowledge building
babel-plugin-macros
vanilla-extract
-
Just Fucking Use HTML
CSS is incredible technology, but holy shit does it feel archaic in a large Typescript project to have a massive design system in a string.
Why canāt I click an element and see the css files that apply to it? Why can I get autocomplete for my utility classes and custom properties? I would happily nuke CSS from a project for a typescript library that could marry the two worlds with minimal trade-offs, but Iāve yet to have the time or courage to dive into a library like vanilla-extract: https://vanilla-extract.style
- Vue3: Como estilizar componentes (global, scoped e modules)
-
CSS-in-JS: Pros and cons
Static extraction libraries like Linaria (2020) and Vanilla Extract (2021) later minimized runtime costs.
-
Not Everything Needs a Component
If you still think a polymorphic component would be better, really can't deal with plain HTML, or donāt want to write CSS in a separate file (though I am not sure why), my next suggestion would be to take a look at PandaCSS and create custom patterns or explore other options like vanilla-extract. In my opinion, these tools are an over-engineered CSS metalanguage but still better than a polymorphic component.
- Rethinking CSS in JS
-
Design System Starter Template - All Technology You'll Ever Need
For styling DSS UI relies on vanilla-extract, which provides a robust scalable zero-runtime CSS base. Yet again, itās a flexible choice, allowing for alternative approaches like CSS modules, Panda CSS, Tailwind etc.
-
30+ CSS libraries and frameworks help you style your applications efficiently.
Vanilla Extract Vanilla Extract is a zero-runtime Stylesheets-in-TypeScript library. It enables type-safe CSS with static extraction for optimal build performance.
-
The best testing strategies for frontends
In our experience, the best testing strategy for modern frontends is a combination of E2E testing (using Playwright+NextJS), and unit testing. Visual regression testing is not worth the effort in our opinion, especially with the advent of better CSS tooling like TailwindCSS and Vanilla Extract.
-
Is there really anything better than Css Modules?
For building component libraries Iāve been a big fan of vanilla extract. Apparently itās from the same people who made css modules
-
Introducing StyleX - the styling system used by Meta
This sounds exactly like Vanilla Extract. https://vanilla-extract.style/
What are some alternatives?
babel-plugin-transform-react-remove-prop-types - Remove unnecessary React propTypes from the production build. :balloon:
panda - š¼ Universal, Type-Safe, CSS-in-JS Framework for Design Systems ā”ļø
babel-plugin-styled-components - Improve the debugging experience and add server-side rendering support to styled-components
shadcn/ui - A set of beautifully-designed, accessible components and a code distribution platform. Works with your favorite frameworks. Open Source. Open Code.
super-expressive - š¦ Super Expressive is a zero-dependency JavaScript library for building regular expressions in (almost) natural language
linaria - Zero-runtime CSS in JS library
