sass conversion cleanup/removal of commented code

This commit is contained in:
Kevin Ross 2015-11-04 17:36:36 -06:00
parent 37342ce4cc
commit e14776f52e
4 changed files with 33 additions and 49 deletions

View File

@ -16,10 +16,11 @@
));
// FIXME: these colors are defined in _colors.scss. Since there is no way to access a variable as a string
// FIXME: in sass, this needs to be changed to get a permutation as an actual variable.
// FIXME: in sass, this needs to be changed to get a permutation as an actual variable object.
// FIXME: http://krasimirtsonev.com/blog/article/SASS-interpolation-in-a-name-of-variable-nest-variables-within-variables
// FIXME: this shows a valid approach and adds a color function: https://github.com/darrenkopp/libsass-net/issues/12
// FIXME: The following shows a valid approach and adds a color lookup function from a map, but would require changes in the less files:
// FIXME: https://github.com/darrenkopp/libsass-net/issues/12
@include generic-variations-color($args-variation-color)
}
}

View File

@ -1,33 +1,6 @@
// This file is NOT automatically converted and must be manually merged
// contrast-color and brightness borrowed from compass
// Copyright (c) 2009-2014 Christopher M. Eppstein
// Complies with license: https://github.com/Compass/compass/blob/stable/LICENSE.markdown
@function contrast-color($color, $dark: $contrasted-dark-default, $light: $contrasted-light-default, $threshold: null) {
@if $threshold {
// Deprecated in Compass 0.13
@warn "The $threshold argment to contrast-color is no longer needed and will be removed in the next release.";
}
@if $color == null {
@return null;
}
@else {
$color-brightness: brightness($color);
$dark-text-brightness: brightness($dark);
$light-text-brightness: brightness($light);
@return if(abs($color-brightness - $light-text-brightness) > abs($color-brightness - $dark-text-brightness), $light, $dark);
}
}
@function brightness($color) {
@if type-of($color) == color {
@return (red($color) * 0.299 + green($color) * 0.587 + blue($color) * 0.114) / 255 * 100%;
}
@else {
@return unquote("brightness(#{$color})");
}
}
@import "mixins-utilities";
// variations(unquote(""), background-color, #FFF);
@mixin variations($extra, $material-param-1, $default) {

View File

@ -0,0 +1,29 @@
// This file is here to emulate the less #contrast function
// contrast-color and brightness borrowed from compass
// Copyright (c) 2009-2014 Christopher M. Eppstein
// Complies with license: https://github.com/Compass/compass/blob/stable/LICENSE.markdown
@function contrast-color($color, $dark: $contrasted-dark-default, $light: $contrasted-light-default, $threshold: null) {
@if $threshold {
// Deprecated in Compass 0.13
@warn "The $threshold argment to contrast-color is no longer needed and will be removed in the next release.";
}
@if $color == null {
@return null;
}
@else {
$color-brightness: brightness($color);
$dark-text-brightness: brightness($dark);
$light-text-brightness: brightness($light);
@return if(abs($color-brightness - $light-text-brightness) > abs($color-brightness - $dark-text-brightness), $light, $dark);
}
}
@function brightness($color) {
@if type-of($color) == color {
@return (red($color) * 0.299 + green($color) * 0.587 + blue($color) * 0.114) / 255 * 100%;
}
@else {
@return unquote("brightness(#{$color})");
}
}

View File

@ -3,8 +3,6 @@
@mixin generic-variations-colors($args) {
//$material-color-names: $red $pink $purple $deep-purple $indigo $blue $light-blue $cyan $teal $green $light-green $lime $yellow $amber $orange $deep-orange $brown $grey $blue-grey;
$material-colors: (
"red": $red,
"pink": $pink,
@ -37,24 +35,7 @@
@include generic-variations-color($args-variation-color)
}
//@each $material-color-name in $material-color-names {
// //// given a color build multiples depths
// //$material-color-numbers: "" "-50" "-100" "-200" "-300" "-400" "-500" "-600" "-700" "-800" "-900" "-A100" "-A200" "-A400" "-A700";
// //@each $material-color-number in $material-color-numbers {
// // @include generic-variations-color($mixin-name, $extra, $default, $contrast-factor, $material-color-name, $material-color-number)
// //}
//
// // build a single depth color palette
// $args-variation-color: map-merge($args, (
// material-color-name: $material-color-name,
// material-color-number: ""
// ));
//
// @include generic-variations-color($args-variation-color)
//}
}
// http://hugogiraudel.com/2014/01/27/casting-types-in-sass/
// https://github.com/HugoGiraudel/SassyJSON/blob/master/stylesheets/decode/helpers/color/_color.scss