GithubHelp home page GithubHelp logo

remixings's Introduction

remixins for {less}

###Automatically convert pixel measures into rem units.

remixins is a collection of {less} mixins that helps you start using rem units without coding pixels fallbacks on every rule. Code your CSS using pixels. remixins will automatically convert them to rem units.

remixins includes {less} mixins for most popular properties where rem is used as a measure unit.

Mixins available for the following CSS properties:

  • font-size, line-height and text-indent.
  • margin(s)
  • padding(s)
  • height and width (including min- and max-)
  • top, left, bottom and right.

How to use it:

  1. Download remixins.less
  2. Set @base-font-size-px (line 2) to your integer root's font size. Note that @base-font-size-px MUST BE AN INTEGER (without any measure unit).
  3. Import downloaded file @import "remixins.less.

Examples:

{less}:

    .element {
        .font-size(16px);
    }

CSS result:

    .element {
        font-size: 16px;
        font-size: 1.6rem;
    }

{less}

    .element {
        .margin(10px, 3%);
    }

CSS result:

    .element {
        margin: 10px 3%;
        margin: 1rem 3%;
    }

Included mixins

  • .font-size(@value)
  • .line-height(@value)
  • .text-indent(@value)
  • .margin(@value)
  • .margin(@vertical, @horizontal)
  • .margin-top(@value)
  • .margin-right(@value)
  • .margin-bottom(@value)
  • .margin-left(@value)
  • .padding(@value)
  • .padding(@vertical, @horizontal)
  • .padding-top(@value)
  • .padding-right(@value)
  • .padding-bottom(@value)
  • .padding-left(@value)
  • .height(@value)
  • .min-height(@value)
  • .max-height(@value)
  • .width(@value)
  • .min-width(@value)
  • .max-width(@value)
  • .top(@value)
  • .left(@value)
  • .bottom(@value)
  • .right(@value)

@chrRamirez

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.