GithubHelp home page GithubHelp logo

fnebenfuehr / moonshine-css Goto Github PK

View Code? Open in Web Editor NEW

This project forked from econify/moonshine-css

1.0 0.0 0.0 766 KB

๐Ÿฅƒ High-proof atomic CSS framework

License: ISC License

JavaScript 3.22% Rust 62.70% TypeScript 33.81% Makefile 0.27%

moonshine-css's Introduction

Moonshine CSS

Features

  • ๐Ÿฅƒ Minimal and simple atomic CSS framework
  • โš—๏ธ 100% customizable - build your own CSS framework
  • ๐Ÿฆ€ Blazing fast generator written in Rust
  • ๐Ÿœ Tiny 1.7 kB runtime
  • โš›๏ธ CSS-in-JS library for React

Install

npm install --save @econify/moonshine-css
yarn add @econify/moonshine-css

Generate Styles

Create a .moonshinerc file in your project root.

by running

npx distill --init

or by creating a file manually:

{
  "options": {
    "atomStyle": "classAttribute",
    "breakpointModifierStyle": "suffix",
    "breakpointModifierSeperator": "-",
    "breakpoints": {
      "sm": { "minWidth": "576px" },
      "md": { "minWidth": "768px", "maxWidth": "992px" },
      "lg": { "minWidth": "992px" }
    }
  },
  "designTokens": ["./atomic-design-tokens.yml"],
  "templates": [
    "./tachyons-border-box.yml",
    "./tachyons-colors.yml",
    "./tachyons-flex.yml",
    "./tachyons-spacing.yml"
  ],
  "output": {
    "cssVariables": "./dist/variables.css",
    "cssAtoms": "./dist/atoms.css",
    "jsonAtoms": "./dist/atoms.json"
  }
}

then run

npx distill --watch

Usage

import "atomic-styles.css";
import { styled } from "@econify/moonshine-css";

const Button = styled.button(
  "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",
  ({ isPrimary }) => isPrimary && "bg-primary text-white"
);

export default Demo() {
  return (
    <div>
      <Button isPrimary={true}>Click me</Button>
    </div>
  );
};

You can read more about the runtime syntax here.

Acknowledgements

TBD

moonshine-css's People

Contributors

craigfay avatar regan-karlewicz avatar

Stargazers

Roman avatar

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.