GithubHelp home page GithubHelp logo

yank's Introduction

@yank

Introduction

@yank lets you treat standard CSS classes like @mixins in Sass.

For example, given tachyons.css as our definitions file, we could write the following @yank rules in a standard css file myclasses.css;

.my-button {
  @yank .bg-blue;
  @yank .white;
  @yank .link;
  @yank .pa2;
  @yank .br2;
}

.my-input {
  @yank .bg-white;
  @yank .ba;
  @yank .b--gray;
  @yank .dark-gray;
  @yank .br2;
  @yank .pa2;
}

You can view this example on jsfiddle.


Running ./yank on the command line will compile this file into the following myclasses--compiled.css:

/* This file was compiled with @yank */
/* See the docs at https://github.com/almonk/yank */
.my-button {
  background-color:#357edd;
  color:#fff;
  text-decoration:none;
  padding:.5rem;
  border-radius:.25rem;
}
.my-input {
  background-color:#fff;
  border-style:solid;
  border-width:1px;
  border-color:#777;
  color:#333;
  border-radius:.25rem;
  padding:.5rem;
}

Usage

You can run these on the command line as; ./yank -input=example/myclasses.css -definitions=example/mycss.css -output=example/myclasses--compiled.css


Help

Running ./yank --help will show you the flags you can pass to @yank

  -definitions string
    	File that @yank uses to expand your classes (default "mycss.css")
  -input string
    	File where your @yank rules are defined (default "myclasses.css")
  -output string
    	CSS file with compiled @yank rules (default "myclasses--compiled.css")

yank's People

Contributors

almonk avatar

Stargazers

Daniel Fosco avatar Paul Schaefer avatar Varun Vachhar avatar Mark Hayes avatar James Greig avatar

Watchers

James Cloos avatar  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.