GithubHelp home page GithubHelp logo

nandovejer / mixincolor Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 140 KB

Mixin sass compass. Edit four arguments: the base color, opacity and the level of dark or light tone

Home Page: http://codepen.io/Silencespainter/full/duDHe/

CSS 100.00%

mixincolor's Introduction

MIXIN BACKGROUND COLOR

DEMO

////// MIXIN BACKGROUND COLOR BY @SILENCESPAINTER
@mixin bg-color($main-color, $opacity-color, $mode-color, $x100-color) {	

  @if $mode-color == normal {
  	// mode-choice = normal
    background:rgba($main-color, $opacity-color);

  } @else if $mode-color == dark {
    // mode-choice = dark
	background:rgba( (darken($main-color,$x100-color)), $opacity-color);

  } @else if $mode-color == light {
    // mode-choice = light
	background:rgba( (lighten($main-color,$x100-color)), $opacity-color);

  } @else {
  	// mode-choice = if there is syntax mistake
    &::before {
    	content: "Error @mixin bg-color, the $mode-color must be lowercase: normal, light or dark";
    	font-size: 3.5em;
    	color: white;
    	background: red;
    	display: inline-block;
    	height: inherit;
    	margin: 0 auto;
    }
  }	

} 

mixincolor's People

Watchers

James Cloos avatar Fernando Muñoz 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.