Added the project's files to the repo
This commit is contained in:
11
assets/sass/bourbon/functions/_assign.scss
vendored
Executable file
11
assets/sass/bourbon/functions/_assign.scss
vendored
Executable file
@ -0,0 +1,11 @@
|
||||
@function assign-inputs($inputs, $pseudo: null) {
|
||||
$list : ();
|
||||
|
||||
@each $input in $inputs {
|
||||
$input: unquote($input);
|
||||
$input: if($pseudo, $input + ":" + $pseudo, $input);
|
||||
$list: append($list, $input, comma);
|
||||
}
|
||||
|
||||
@return $list;
|
||||
}
|
13
assets/sass/bourbon/functions/_color-lightness.scss
vendored
Executable file
13
assets/sass/bourbon/functions/_color-lightness.scss
vendored
Executable file
@ -0,0 +1,13 @@
|
||||
// Programatically determines whether a color is light or dark
|
||||
// Returns a boolean
|
||||
// More details here http://robots.thoughtbot.com/closer-look-color-lightness
|
||||
|
||||
@function is-light($hex-color) {
|
||||
$-local-red: red(rgba($hex-color, 1.0));
|
||||
$-local-green: green(rgba($hex-color, 1.0));
|
||||
$-local-blue: blue(rgba($hex-color, 1.0));
|
||||
|
||||
$-local-lightness: ($-local-red * 0.2126 + $-local-green * 0.7152 + $-local-blue * 0.0722) / 255;
|
||||
|
||||
@return $-local-lightness > .6;
|
||||
}
|
12
assets/sass/bourbon/functions/_contains.scss
vendored
Executable file
12
assets/sass/bourbon/functions/_contains.scss
vendored
Executable file
@ -0,0 +1,12 @@
|
||||
// Test a Sass list to see if it contains a defined value
|
||||
// Allows for checking if a list contains several values at once
|
||||
|
||||
@function contains($list, $values...) {
|
||||
@each $value in $values {
|
||||
@if type-of(index($list, $value)) != "number" {
|
||||
@return false;
|
||||
}
|
||||
}
|
||||
|
||||
@return true;
|
||||
}
|
7
assets/sass/bourbon/functions/_is-length.scss
vendored
Executable file
7
assets/sass/bourbon/functions/_is-length.scss
vendored
Executable file
@ -0,0 +1,7 @@
|
||||
// Check for a valid length
|
||||
|
||||
@function is-length($value) {
|
||||
@return type-of($value) != "null" and (str-slice($value + "", 1, 4) == 'calc'
|
||||
or index(auto inherit initial 0, $value)
|
||||
or (type-of($value) == "number" and not(unitless($value))));
|
||||
}
|
6
assets/sass/bourbon/functions/_is-size.scss
vendored
Executable file
6
assets/sass/bourbon/functions/_is-size.scss
vendored
Executable file
@ -0,0 +1,6 @@
|
||||
// Check for a valid size
|
||||
|
||||
@function is-size($value) {
|
||||
@return is-length($value)
|
||||
or contains("fill" "fit-content" "min-content" "max-content", $value);
|
||||
}
|
69
assets/sass/bourbon/functions/_modular-scale.scss
vendored
Executable file
69
assets/sass/bourbon/functions/_modular-scale.scss
vendored
Executable file
@ -0,0 +1,69 @@
|
||||
// Scaling Variables
|
||||
$golden: 1.618;
|
||||
$minor-second: 1.067;
|
||||
$major-second: 1.125;
|
||||
$minor-third: 1.2;
|
||||
$major-third: 1.25;
|
||||
$perfect-fourth: 1.333;
|
||||
$augmented-fourth: 1.414;
|
||||
$perfect-fifth: 1.5;
|
||||
$minor-sixth: 1.6;
|
||||
$major-sixth: 1.667;
|
||||
$minor-seventh: 1.778;
|
||||
$major-seventh: 1.875;
|
||||
$octave: 2;
|
||||
$major-tenth: 2.5;
|
||||
$major-eleventh: 2.667;
|
||||
$major-twelfth: 3;
|
||||
$double-octave: 4;
|
||||
|
||||
$modular-scale-ratio: $perfect-fourth !default;
|
||||
$modular-scale-base: em($em-base) !default;
|
||||
|
||||
@function modular-scale($increment, $value: $modular-scale-base, $ratio: $modular-scale-ratio) {
|
||||
$v1: nth($value, 1);
|
||||
$v2: nth($value, length($value));
|
||||
$value: $v1;
|
||||
|
||||
// scale $v2 to just above $v1
|
||||
@while $v2 > $v1 {
|
||||
$v2: ($v2 / $ratio); // will be off-by-1
|
||||
}
|
||||
@while $v2 < $v1 {
|
||||
$v2: ($v2 * $ratio); // will fix off-by-1
|
||||
}
|
||||
|
||||
// check AFTER scaling $v2 to prevent double-counting corner-case
|
||||
$double-stranded: $v2 > $v1;
|
||||
|
||||
@if $increment > 0 {
|
||||
@for $i from 1 through $increment {
|
||||
@if $double-stranded and ($v1 * $ratio) > $v2 {
|
||||
$value: $v2;
|
||||
$v2: ($v2 * $ratio);
|
||||
} @else {
|
||||
$v1: ($v1 * $ratio);
|
||||
$value: $v1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if $increment < 0 {
|
||||
// adjust $v2 to just below $v1
|
||||
@if $double-stranded {
|
||||
$v2: ($v2 / $ratio);
|
||||
}
|
||||
|
||||
@for $i from $increment through -1 {
|
||||
@if $double-stranded and ($v1 / $ratio) < $v2 {
|
||||
$value: $v2;
|
||||
$v2: ($v2 / $ratio);
|
||||
} @else {
|
||||
$v1: ($v1 / $ratio);
|
||||
$value: $v1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@return $value;
|
||||
}
|
13
assets/sass/bourbon/functions/_px-to-em.scss
vendored
Executable file
13
assets/sass/bourbon/functions/_px-to-em.scss
vendored
Executable file
@ -0,0 +1,13 @@
|
||||
// Convert pixels to ems
|
||||
// eg. for a relational value of 12px write em(12) when the parent is 16px
|
||||
// if the parent is another value say 24px write em(12, 24)
|
||||
|
||||
@function em($pxval, $base: $em-base) {
|
||||
@if not unitless($pxval) {
|
||||
$pxval: strip-units($pxval);
|
||||
}
|
||||
@if not unitless($base) {
|
||||
$base: strip-units($base);
|
||||
}
|
||||
@return ($pxval / $base) * 1em;
|
||||
}
|
15
assets/sass/bourbon/functions/_px-to-rem.scss
vendored
Executable file
15
assets/sass/bourbon/functions/_px-to-rem.scss
vendored
Executable file
@ -0,0 +1,15 @@
|
||||
// Convert pixels to rems
|
||||
// eg. for a relational value of 12px write rem(12)
|
||||
// Assumes $em-base is the font-size of <html>
|
||||
|
||||
@function rem($pxval) {
|
||||
@if not unitless($pxval) {
|
||||
$pxval: strip-units($pxval);
|
||||
}
|
||||
|
||||
$base: $em-base;
|
||||
@if not unitless($base) {
|
||||
$base: strip-units($base);
|
||||
}
|
||||
@return ($pxval / $base) * 1rem;
|
||||
}
|
5
assets/sass/bourbon/functions/_strip-units.scss
vendored
Executable file
5
assets/sass/bourbon/functions/_strip-units.scss
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
// Srtips the units from a value. e.g. 12px -> 12
|
||||
|
||||
@function strip-units($val) {
|
||||
@return ($val / ($val * 0 + 1));
|
||||
}
|
9
assets/sass/bourbon/functions/_tint-shade.scss
vendored
Executable file
9
assets/sass/bourbon/functions/_tint-shade.scss
vendored
Executable file
@ -0,0 +1,9 @@
|
||||
// Add percentage of white to a color
|
||||
@function tint($color, $percent){
|
||||
@return mix(white, $color, $percent);
|
||||
}
|
||||
|
||||
// Add percentage of black to a color
|
||||
@function shade($color, $percent){
|
||||
@return mix(black, $color, $percent);
|
||||
}
|
22
assets/sass/bourbon/functions/_transition-property-name.scss
vendored
Executable file
22
assets/sass/bourbon/functions/_transition-property-name.scss
vendored
Executable file
@ -0,0 +1,22 @@
|
||||
// Return vendor-prefixed property names if appropriate
|
||||
// Example: transition-property-names((transform, color, background), moz) -> -moz-transform, color, background
|
||||
//************************************************************************//
|
||||
@function transition-property-names($props, $vendor: false) {
|
||||
$new-props: ();
|
||||
|
||||
@each $prop in $props {
|
||||
$new-props: append($new-props, transition-property-name($prop, $vendor), comma);
|
||||
}
|
||||
|
||||
@return $new-props;
|
||||
}
|
||||
|
||||
@function transition-property-name($prop, $vendor: false) {
|
||||
// put other properties that need to be prefixed here aswell
|
||||
@if $vendor and $prop == transform {
|
||||
@return unquote('-'+$vendor+'-'+$prop);
|
||||
}
|
||||
@else {
|
||||
@return $prop;
|
||||
}
|
||||
}
|
17
assets/sass/bourbon/functions/_unpack.scss
vendored
Executable file
17
assets/sass/bourbon/functions/_unpack.scss
vendored
Executable file
@ -0,0 +1,17 @@
|
||||
// Convert shorthand to the 4-value syntax
|
||||
|
||||
@function unpack($shorthand) {
|
||||
@if length($shorthand) == 1 {
|
||||
@return nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1);
|
||||
}
|
||||
@else if length($shorthand) == 2 {
|
||||
@return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 1) nth($shorthand, 2);
|
||||
}
|
||||
@else if length($shorthand) == 3 {
|
||||
@return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 3) nth($shorthand, 2);
|
||||
}
|
||||
@else {
|
||||
@return $shorthand;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user