Giter Club home page Giter Club logo

Comments (4)

Mokshit06 avatar Mokshit06 commented on May 27, 2024

What are the main use cases that you see of sprinkles that macaron doesn't provide right now?

from macaron.

endigma avatar endigma commented on May 27, 2024

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.

kee-oth avatar kee-oth commented on May 27, 2024

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.

Mokshit06 avatar Mokshit06 commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.