Skip to content
프로젝트

macaron-css/macaron has 787 GitHub stars and 22 forks. GitHot measured 0 stars in 24 hours and +1 in 7 days. Last checked 2026-11-25 04:08 UTC. Last push 2026-09-11.

이 수치를 측정하는 방법

What you can do

  • Zero runtime bundles with build time style extraction.
  • Colocation of styles and components.
  • First class Typescript support.
  • Supports both styled-components API and vanilla styling API.

측정된 스타 증가

in 24h
0
in 7 days
+1
in 15 days
기록 수집 중
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

소개

컴파일러로 타입 안전성을 강화한 CSS-in-JS로, 런타임 오버헤드 없이 코드와 스타일을 함께 배치하고 안전성과 생산성을 극대화합니다

웹 및 앱

README.md

Original

CSS-in-JS with zero runtime, type safety and colocation

Features

  • Zero runtime bundles with build time style extraction.
  • Colocation of styles and components.
  • First class Typescript support.
  • Supports both styled-components API and vanilla styling API.
  • Stitches-like variants API.
  • Out of box support for React, Solid and Qwik.
  • Integrations for esbuild and Vite.

Documentation

For full documentation, visit https://macaron.js.org

Example

Styled API

// or import it from @macaron-css/solid
import { styled } from '@macaron-css/react';

const Button = styled('button', {
  base: {
    borderRadius: 6,
  },
  variants: {
    color: {
      neutral: { background: 'whitesmoke' },
      brand: { background: 'blueviolet' },
      accent: { background: 'slateblue' },
    },
    size: {
      small: { padding: 12 },
      medium: { padding: 16 },
      large: { padding: 24 },
    },
    rounded: {
      true: { borderRadius: 999 },
    },
  },
  compoundVariants: [
    {
      variants: {
        color: 'neutral',
        size: 'large',
      },
      style: {
        background: 'ghostwhite',
      },
    },
  ],

  defaultVariants: {
    color: 'accent',
    size: 'medium',
  },
});

// Use it like a regular solidjs/react component
function App() {
  return (
    <Button color="accent" size="small" rounded>
      Click me!
    </Button>
  );
}

Styling API

The styling API is the same api is vanilla-extract, but allows styles to be defined in the same file, improving the DX.

Check out vanilla-extract docs for the API reference.

These functions can also be called directly inside expressions to provide a css prop-like API with zero-runtime cost:-

import { style } from '@macaron-css/core';

function App() {
  return (
    <div
      class={style({
        display: 'flex',
        padding: '10px',
      })}
    >
      <button class={style({ color: 'red' })}>Click me</button>
    </div>
  );
}

Playground

You can try about these above examples at https://macaron.js.org/playground and see how macaron figures out which expressions have to be extracted and what your code would look like after being transpiled

How it works

https://macaron.js.org/docs/working/

Acknowledgements

  • Vanilla Extract Thanks to the vanilla-extract team for their work on VE, which macaron uses for evaluating files.

  • Dax Raad Thanks to Dax for helping me with this and thoroughly testing it outß, helping me find numerous bugs and improving macaron.

관련 프로젝트 살펴보기

불러오는 중…