Comments (4)
What are the main use cases that you see of sprinkles that macaron doesn't provide right now?
from macaron.
Ease of use, sprinkles doesn't use normal CSS properties, it's more like tailwind. You're intended to create many sprinkles and mix them together for "Atomic CSS"
from macaron.
I actually came to the Macaron GitHub issues today to request a feature similar to Sprinkles and found this ticket! Timely!
I actually didn't know what Sprinkles was but I wanted something like it. I'm basically looking for a CSS-in-JS level of ergonomics but with extracted, atomic CSS like Tailwind offers. I like the extracted, atomic CSS because it deduplicates any CSS properties you used and creates super tiny CSS files. Making it unnecessary to worry about things like "above the fold CSS" vs the rest of the CSS.
I was hoping Stitches would get there eventually (at least with extracted CSS) but Stitches seems to be slowing down right now and rumors have started that it's considered "feature complete". So I've come to Macaron in hopes to find what I'm looking for!
from macaron.
I'm not sure if I'm comfortable with expanding the scope of macaron's core lib to include atomic css, though it should be very easy to use sprinkles with macaron's compiler to get colocated styles. With this setup you can define the sprinkles in any file, and not be restricted to .css.ts
files, and this would work with macaron's build plugin.
Just install @vanilla-extract/sprinkles
and then when calling functions like defineProperties
or createSprinkles
wrap them inside macaron$
exported from @macaron-css/core
like:-
import { macaron$ } from "@macaron-css/core"
import {
defineProperties,
createSprinkles
} from '@vanilla-extract/sprinkles';
const responsiveProperties = macaron$(() => defineProperties({
conditions: {},
// etc..
}))
export const sprinkles = macaron$(() => createSprinkles(
responsiveProperties,
));
After this you can use these like you normally would use sprinkles. Macaron will extract all the css of sprinkles styles
from macaron.
Related Issues (20)
- Forward prop types when styling a custom component HOT 7
- Ability to extend babel config in Vite? HOT 2
- Prop "as" of styled components can be a component HOT 4
- Console warning when sourcemaps are enabled HOT 2
- Integration of Kobalte or Ark with Macaron: Is it Possible to Combine Them? HOT 2
- Vite build watch doesn't work with Macaron HOT 7
- Is it possible to support the responsive variants approach from Stitches? HOT 1
- styled components don't overwrite their parent when they come from another file
- qwik js support HOT 3
- Dynamic styling example in docs (still) doesn't work HOT 2
- [URGENT] Vite 5.0.10 upgrade not working with Macaron HOT 4
- `createVar` not working as expected? HOT 1
- [Documentation] Lack of docs for compoundVariants option HOT 1
- [Feature] Support @keyframes for animation HOT 1
- [Bug?] How to make createVar works? HOT 5
- Solid.js types not being referenced correctly HOT 1
- Vite plugin using deprecated API HOT 1
- Types not working for Solid HOT 9
- Custom CSS insertion point via macros HOT 2
- [Feature] Responsive API HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from macaron.