twin.examples
twin.macro
Our great sponsors
twin.examples | twin.macro | |
---|---|---|
5 | 57 | |
460 | 7,802 | |
- | - | |
6.1 | 6.1 | |
17 days ago | 20 days ago | |
TypeScript | TypeScript | |
- | 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.
twin.examples
-
How to load a GLTF model inside NextJS in 2022
Hey, I'm trying (and failing) to put together a codesandbox. I think it's easier to replicate the steps from here: https://github.com/ben-rogerson/twin.examples/tree/master/next-styled-components
-
How to set up _document.js with twin.macro + Google Analytics ?
well, this is exactly how it's set up in the twin.macro example repo with next.js, and it is working perfectly fine?
-
How to setup create-react-app twin.macro and emotion
You can pretty much follow all the steps from this tutorial, until this point where it tells you to extend JSX with a jsx-pragma in front of every twin.macro import. The documentation underneath says the following:
-
How to Build A React TS Tailwind Design System
Alright, I had my tools in place and it was time to start connecting the dots, so to speak. I kicked off a new TSDX project, installed Styled components, and then went on to try and set up twin.macro. However, I hit a snag there... In the Twin example repo, there was no Styled Components + Storybook example, so I configured what seemed to make sense. Then I went on to add some samples, imported them into a new Story, and tried to run Storybook. It didn't work as expected. Some of the code worked and other components that were using the tw syntax didn't:
-
Boilerplate with React 17, Webpack 5, Tailwind 2, using babel, sass, with a hot dev server and an optimized production build
the biggest would be as a plugin to compile/transpile other language macros for example twin-macro (styled components using tailwind syntax) https://github.com/ben-rogerson/twin.examples/tree/master/component-library-styled-components/packages/components
twin.macro
-
Tailwindcss in Styled-Components
Twin Macro Github Repo. This is a great resource to help you pick up Twin’s syntax, learn more about the package, and keep up to date with the latest releases.
-
CSS Style Guide for Web Dev?
Personally I like twin.macro the most. It’s similar to the above but based on Tailwind.
-
Cool Tailwindcss Tools For Everyone
twin.macro is a library that allows you to use these styles in your JavaScript code. This library works exactly like styled-components.
- How do you css?
-
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:
-
Setup Nextjs Tailwind CSS Styled Components with TypeScript
twin.macro
-
What unpopular webdev opinions do you have?
If you use Tailwind with React a lot, and are wanting support for Styled Components, give Twin Macro a look. They're close to finishing support for TW v3 in their Releases section :)
- Are utility classes horrible design or am I dumb?
- What's the proper way to write Tailwind with React?
-
Stailwc: an swc plugin for transpiling tailwind directives at compile time
The blocker for us using it is our use of an excellent library called twin.macro which is built against babel's transpilation APIs to parse tailwindcss directives at compile time so that they may be used with css-in-js libraries. This efficiently bundles your css so that you only ship the precise css you use. The problem is, it's all quite slow.
What are some alternatives?
prettier-eslint - Code :arrow_right: prettier :arrow_right: eslint --fix :arrow_right: Formatted Code :sparkles:
twind - The smallest, fastest, most feature complete Tailwind-in-JS solution in existence.
tailpress - TailPress is a minimal boilerplate theme for WordPress using Tailwind CSS.
Tailwind CSS - A utility-first CSS framework for rapid UI development.
craco - Create React App Configuration Override, an easy and comprehensible configuration layer for Create React App.
tailwindcss-classnames - Functional typed classnames for TailwindCSS
eslint-config-prettier - Turns off all rules that are unnecessary or might conflict with Prettier.
jest-styled-components - 🔧 💅 Jest utilities for Styled Components
react-webpack-5-tailwind-2 - React 17 Boilerplate with Webpack 6, Tailwind 2, using babel, SASS/PostCSS, HMR, dotenv and an optimized production build
vue-emotion - Seamlessly use emotion (CSS-in-JS) with Vue.js
PostCSS - Transforming styles with JS plugins
tailwind-safelist-generator - Tailwind plugin to generate purge-safe.txt files