view release on metacpan or search on metacpan
lib/CSS/Sass/Type.pm view on Meta::CPAN
sub g { $accessor->('g', @_) }
sub b { $accessor->('b', @_) }
sub a { $accessor->('a', @_) }
sub stringify {
my $r = ${$_[0]}->{'r'};
my $g = ${$_[0]}->{'g'};
my $b = ${$_[0]}->{'b'};
my $a = ${$_[0]}->{'a'};
unless (defined $a && $a != 0) {
"transparent"
} elsif (defined $a && $a != 1) {
sprintf("rgba(%s, %s, %s, %s)", $r, $g, $b, $a)
} elsif ($r || $g || $b) {
sprintf("rgb(%s, %s, %s)", $r, $g, $b)
} else {
"null"
}
}
sub equals {
libsass/color_names.hpp view on Meta::CPAN
"tomato",
"turquoise",
"violet",
"wheat",
"white",
"whitesmoke",
"yellow",
"yellowgreen",
// rebeccapurple
"rebeccapurple",
// transparent
"transparent",
// sentinel value
0
};
const double color_values[] =
{
0xf0, 0xf8, 0xff, 1,
0xfa, 0xeb, 0xd7, 1,
0x00, 0xff, 0xff, 1,
0x7f, 0xff, 0xd4, 1,
libsass/color_names.hpp view on Meta::CPAN
0xff, 0x63, 0x47, 1,
0x40, 0xe0, 0xd0, 1,
0xee, 0x82, 0xee, 1,
0xf5, 0xde, 0xb3, 1,
0xff, 0xff, 0xff, 1,
0xf5, 0xf5, 0xf5, 1,
0xff, 0xff, 0x00, 1,
0x9a, 0xcd, 0x32, 1,
// rebeccapurple
0x66, 0x33, 0x99, 1,
// transparent
0x00, 0x00, 0x00, 0,
// sentinel value
0xfff
};
}
#endif
libsass/context.cpp view on Meta::CPAN
register_function(ctx, saturate_sig, saturate, env);
register_function(ctx, desaturate_sig, desaturate, env);
register_function(ctx, grayscale_sig, grayscale, env);
register_function(ctx, complement_sig, complement, env);
register_function(ctx, invert_sig, invert, env);
// Opacity Functions
register_function(ctx, alpha_sig, alpha, env);
register_function(ctx, opacity_sig, alpha, env);
register_function(ctx, opacify_sig, opacify, env);
register_function(ctx, fade_in_sig, opacify, env);
register_function(ctx, transparentize_sig, transparentize, env);
register_function(ctx, fade_out_sig, transparentize, env);
// Other Color Functions
register_function(ctx, adjust_color_sig, adjust_color, env);
register_function(ctx, scale_color_sig, scale_color, env);
register_function(ctx, change_color_sig, change_color, env);
register_function(ctx, ie_hex_str_sig, ie_hex_str, env);
// String Functions
register_function(ctx, unquote_sig, sass_unquote, env);
register_function(ctx, quote_sig, sass_quote, env);
register_function(ctx, str_length_sig, str_length, env);
register_function(ctx, str_insert_sig, str_insert, env);
libsass/functions.cpp view on Meta::CPAN
Color* color = ARG("$color", Color);
double amount = ARGR("$amount", Number, 0, 1)->value();
double alpha = std::min(color->a() + amount, 1.0);
return new (ctx.mem) Color(pstate,
color->r(),
color->g(),
color->b(),
alpha);
}
Signature transparentize_sig = "transparentize($color, $amount)";
Signature fade_out_sig = "fade-out($color, $amount)";
BUILT_IN(transparentize)
{
Color* color = ARG("$color", Color);
double amount = ARGR("$amount", Number, 0, 1)->value();
double alpha = std::max(color->a() - amount, 0.0);
return new (ctx.mem) Color(pstate,
color->r(),
color->g(),
color->b(),
alpha);
}
libsass/functions.hpp view on Meta::CPAN
extern Signature darken_sig;
extern Signature saturate_sig;
extern Signature desaturate_sig;
extern Signature grayscale_sig;
extern Signature complement_sig;
extern Signature invert_sig;
extern Signature alpha_sig;
extern Signature opacity_sig;
extern Signature opacify_sig;
extern Signature fade_in_sig;
extern Signature transparentize_sig;
extern Signature fade_out_sig;
extern Signature adjust_color_sig;
extern Signature scale_color_sig;
extern Signature change_color_sig;
extern Signature ie_hex_str_sig;
extern Signature unquote_sig;
extern Signature quote_sig;
extern Signature str_length_sig;
extern Signature str_insert_sig;
extern Signature str_index_sig;
libsass/functions.hpp view on Meta::CPAN
BUILT_IN(adjust_hue);
BUILT_IN(lighten);
BUILT_IN(darken);
BUILT_IN(saturate);
BUILT_IN(desaturate);
BUILT_IN(grayscale);
BUILT_IN(complement);
BUILT_IN(invert);
BUILT_IN(alpha);
BUILT_IN(opacify);
BUILT_IN(transparentize);
BUILT_IN(adjust_color);
BUILT_IN(scale_color);
BUILT_IN(change_color);
BUILT_IN(ie_hex_str);
BUILT_IN(sass_unquote);
BUILT_IN(sass_quote);
BUILT_IN(str_length);
BUILT_IN(str_insert);
BUILT_IN(str_index);
BUILT_IN(str_slice);
libsass/inspect.cpp view on Meta::CPAN
hexlet << hex << setw(2) << static_cast<unsigned long>(r);
hexlet << hex << setw(2) << static_cast<unsigned long>(g);
hexlet << hex << setw(2) << static_cast<unsigned long>(b);
}
// retain the originally specified color definition if unchanged
if (name != "") {
ss << name;
}
else if (r == 0 && g == 0 && b == 0 && a == 0) {
ss << "transparent";
}
else if (a >= 1) {
if (res_name != "") {
if (want_short && hexlet.str().size() < res_name.size()) {
ss << hexlet.str();
} else {
ss << res_name;
}
}
else {
t/04_xs_value_types.t view on Meta::CPAN
is $color_rgb->g, 43, "color_rgb g is correct";
is $color_rgb->b, 44, "color_rgb b is correct";
is $color_rgb->a, 1, "color_rgb a is correct";
is $color_rgba, "rgba(1, 2, 3, 0.4)", "color_rgba stringify is correct";
is $color_rgba->r, 1, "color_rgba r is correct";
is $color_rgba->g, 2, "color_rgba g is correct";
is $color_rgba->b, 3, "color_rgba b is correct";
is $color_rgba->a, 0.4, "color_rgba a is correct";
is $color_trans, "transparent", "color without opacity is transparent";
################################################################################
test_number($number);
test_number($number_null);
test_number($number_42);
test_number($number_px);
test_number($number_percent);
is $number, "0", "number stringify is correct";
t/sass-spec/benchmarks/vanilla_css_huge.scss view on Meta::CPAN
.form-link-wrapper {
text-align: center; }
.form-link {
line-height: 35px;
padding: 0 30px; }
.form-select {
position: relative; }
.form-select .form-input {
background: transparent;
border: 1px solid #b0b0b0;
font-size: 16px;
border-radius: 0;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
text-indent: 0.01px;
text-overflow: '';
z-index: 99; }
.form-select .form--error {
t/sass-spec/benchmarks/vanilla_css_huge.scss view on Meta::CPAN
background: #037bac;
padding: 20px;
text-align: center;
position: relative; }
.casestudy-quote-attribution:after {
content: '';
display: block;
height: 0px;
width: 0px;
border-top: 15px solid white;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
position: absolute;
top: 0;
left: 50%;
margin-left: -20px; }
.casestudy-quote-name {
color: white;
font-size: 18px;
font-weight: 400;
display: block;
t/sass-spec/benchmarks/vanilla_css_huge.scss view on Meta::CPAN
@media screen and (min-width: 960px) {
.pricing-row:nth-of-type(4) .pricing-cell:after {
content: ' ';
display: block;
position: absolute;
left: 50%;
width: 0;
top: 0;
margin-left: -20px;
border-top: 15px solid #00b4ea;
border-left: 20px solid transparent;
border-right: 20px solid transparent; } }
@media screen and (min-width: 960px) {
.pricing-row:nth-of-type(4) .pricing-cell:nth-of-type(3):after {
content: ' ';
display: block;
position: absolute;
left: 50%;
width: 0;
top: 0;
margin-left: -20px;
border-top: 15px solid #00ac4d;
border-left: 20px solid transparent;
border-right: 20px solid transparent; } }
@media screen and (min-width: 960px) {
.pricing-row:nth-of-type(4) .pricing-cell:nth-of-type(4):after {
content: ' ';
display: block;
position: absolute;
left: 50%;
width: 0;
top: 0;
margin-left: -20px;
border-top: 15px solid #00ac4d;
border-left: 20px solid transparent;
border-right: 20px solid transparent; } }
.pricing-header-developer {
padding: 15px 5px;
border-left: 20px solid #f5f6f6;
background: #009ecd;
color: white;
font-weight: 400;
text-transform: uppercase;
font-size: 18px;
letter-spacing: 0.02;
t/sass-spec/benchmarks/vanilla_css_huge.scss view on Meta::CPAN
background: none; }
.main-header.mw-new-new .main-header-navlist > .menu-item:first-child {
border: 0; }
.main-header.mw-new-new .main-header-navlist > .menu-item:last-child a {
margin: 0; }
.main-header.mw-new-new .main-header-navlist > .menu-item:hover {
background: none; }
.main-header.mw-new-new .main-header-navlist > .menu-item > .sub-menu {
left: -15px;
padding-top: 1.45em;
background: transparent; } }
.features2 {
*zoom: 1;
display: block; }
.features2:before, .features2:after {
content: " ";
display: table; }
.features2:after {
clear: both; }
t/sass-spec/spec/colors/fade-out/input.scss view on Meta::CPAN
p {
color: fade-out(#f00, 0.3);
color: fade-out(#900, 0.8);
color: fade-out(#000, .6);
color: fade-out(#fff, .2);
color: fade-out(#999, .4);
color: fade-out(#000, .5);
color: fade-out(#333, +.99);
// test old function name
color: transparentize(#f00, 0.3);
color: transparentize(#900, 0.8);
color: transparentize(#000, .6);
color: transparentize(#fff, .2);
color: transparentize(#999, .4);
color: transparentize(#000, .5);
color: transparentize(#333, +.99);
}
t/sass-spec/spec/libsass-closed-issues/issue_700/input.scss view on Meta::CPAN
.selector {
color: invert(transparent);
}
t/sass-spec/spec/libsass/bourbon/expected.compact.css view on Meta::CPAN
box:hover { -webkit-animation-name: scale, slide; -moz-animation-name: scale, slide; animation-name: scale, slide; -webkit-animation-duration: 2s; -moz-animation-duration: 2s; animation-duration: 2s; -webkit-animation-timing-function: ease; -moz-anim...
div { -webkit-appearance: none; -moz-appearance: none; -ms-appearance: none; -o-appearance: none; appearance: none; /* boo boo boo */ background-image: url("/images/a.png"), url("images/b.png"); background-image: url("/images/a.png"), url("images/b.p...
t/sass-spec/spec/libsass/bourbon/expected.compressed.css view on Meta::CPAN
box:hover{-webkit-animation-name:scale,slide;-moz-animation-name:scale,slide;animation-name:scale,slide;-webkit-animation-duration:2s;-moz-animation-duration:2s;animation-duration:2s;-webkit-animation-timing-function:ease;-moz-animation-timing-functi...
t/sass-spec/spec/libsass/bourbon/expected.expanded.css view on Meta::CPAN
div {
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
-o-appearance: none;
appearance: none;
/* boo boo boo */
background-image: url("/images/a.png"), url("images/b.png");
background-image: url("/images/a.png"), url("images/b.png");
background-image: url("/images/a.png"), -webkit-linear-gradient( white 0, yellow 50%, transparent 50%);
background-image: url("/images/a.png"), linear-gradient( white 0, yellow 50%, transparent 50%);
background-image: -webkit-linear-gradient( rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 50%), -webkit-linear-gradient( #4e7ba3, #3e6181);
background-image: linear-gradient( rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 50%), linear-gradient( #4e7ba3, #3e6181);
background-image: -webkit-url("/images/a.png")-gradient( center), -webkit-url("images/b.png")-gradient( left);
background-image: url("/images/a.png")-gradient( center), url("images/b.png")-gradient( left);
}
t/sass-spec/spec/libsass/bourbon/expected_output.css view on Meta::CPAN
div {
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
-o-appearance: none;
appearance: none;
/* boo boo boo */
background-image: url("/images/a.png"), url("images/b.png");
background-image: url("/images/a.png"), url("images/b.png");
background-image: url("/images/a.png"), -webkit-linear-gradient( white 0, yellow 50%, transparent 50%);
background-image: url("/images/a.png"), linear-gradient( white 0, yellow 50%, transparent 50%);
background-image: -webkit-linear-gradient( rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 50%), -webkit-linear-gradient( #4e7ba3, #3e6181);
background-image: linear-gradient( rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 50%), linear-gradient( #4e7ba3, #3e6181);
background-image: -webkit-url("/images/a.png")-gradient( center), -webkit-url("images/b.png")-gradient( left);
background-image: url("/images/a.png")-gradient( center), url("images/b.png")-gradient( left); }
t/sass-spec/spec/libsass/bourbon/input.scss view on Meta::CPAN
}
div {
@include appearance(none);
/* boo boo boo */
// Multiple image assets
@include background-image(url("/images/a.png"), url("images/b.png"));
// Image asset with a linear-gradient
@include background-image(url("/images/a.png"), linear-gradient(white 0, yellow 50%, transparent 50%));
// Multiple linear-gradients - Demo
@include background-image(linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%),
linear-gradient(#4e7ba3, darken(#4e7ba4, 10%)));
// NOT SUPPORTED - Multiple image assets with shorthand notation
@include background-image(url("/images/a.png") center no-repeat, url("images/b.png") left repeat);
}
t/sass-spec/spec/libsass/bourbon/lib/addons/_hide-text.scss view on Meta::CPAN
@mixin hide-text {
color: transparent;
font: 0/0 a;
text-shadow: none;
}
t/sass-spec/spec/libsass/bourbon/lib/addons/_triangle.scss view on Meta::CPAN
@mixin triangle ($size, $color, $direction) {
height: 0;
width: 0;
@if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) {
border-color: transparent;
border-style: solid;
border-width: $size / 2;
@if $direction == up {
border-bottom-color: $color;
} @else if $direction == right {
border-left-color: $color;
} @else if $direction == down {
t/sass-spec/spec/libsass/bourbon/lib/addons/_triangle.scss view on Meta::CPAN
} @else if $direction == left {
border-right-color: $color;
}
}
@else if ($direction == up-right) or ($direction == up-left) {
border-top: $size solid $color;
@if $direction == up-right {
border-left: $size solid transparent;
} @else if $direction == up-left {
border-right: $size solid transparent;
}
}
@else if ($direction == down-right) or ($direction == down-left) {
border-bottom: $size solid $color;
@if $direction == down-right {
border-left: $size solid transparent;
} @else if $direction == down-left {
border-right: $size solid transparent;
}
}
}
t/sass-spec/spec/libsass/bourbon/lib/css3/_background-image.scss view on Meta::CPAN
}
}
@return $images-prefixed;
}
//Examples:
//@include background-image(linear-gradient(top, orange, red));
//@include background-image(radial-gradient(50% 50%, cover circle, orange, red));
//@include background-image(url("/images/a.png"), linear-gradient(orange, red));
//@include background-image(url("image.png"), linear-gradient(orange, red), url("image.png"));
//@include background-image(linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient(orange, red));
t/sass-spec/spec/libsass/bourbon/lib/css3/_background.scss view on Meta::CPAN
$background-9: false, $background-10: false,
$fallback: false
) {
$backgrounds: compact($background-1, $background-2,
$background-3, $background-4,
$background-5, $background-6,
$background-7, $background-8,
$background-9, $background-10);
$fallback-color: false;
@if (type-of($fallback) == color) or ($fallback == "transparent") {
$fallback-color: $fallback;
}
@else {
$fallback-color: _extract-background-color($backgrounds);
}
@if $fallback-color {
background-color: $fallback-color;
}
background: _background-add-prefix($backgrounds, webkit);
t/sass-spec/spec/libsass/bourbon/lib/css3/_linear-gradient.scss view on Meta::CPAN
$G9: false, $G10: false,
$deprecated-pos1: left top,
$deprecated-pos2: left bottom,
$fallback: false) {
// Detect what type of value exists in $pos
$pos-type: type-of(nth($pos, 1));
$pos-spec: null;
$pos-degree: null;
// If $pos is missing from mixin, reassign vars and add default position
@if ($pos-type == color) or (nth($pos, 1) == "transparent") {
$G10: $G9; $G9: $G8; $G8: $G7; $G7: $G6; $G6: $G5;
$G5: $G4; $G4: $G3; $G3: $G2; $G2: $G1; $G1: $pos;
$pos: null;
}
@if $pos {
$positions: _linear-positions-parser($pos);
$pos-degree: nth($positions, 1);
$pos-spec: nth($positions, 2);
}
$full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
// Set $G1 as the default fallback color
$fallback-color: nth($G1, 1);
// If $fallback is a color use that color as the fallback color
@if (type-of($fallback) == color) or ($fallback == "transparent") {
$fallback-color: $fallback;
}
background-color: $fallback-color;
background-image: _deprecated-webkit-gradient(linear, $deprecated-pos1, $deprecated-pos2, $full); // Safari <= 5.0
background-image: -webkit-linear-gradient($pos-degree $full); // Safari 5.1+, Chrome
background-image: unquote("linear-gradient(#{$pos-spec}#{$full})");
}
t/sass-spec/spec/libsass/bourbon/lib/css3/_radial-gradient.scss view on Meta::CPAN
$full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
// Strip deprecated cover/contain for spec
$shape-size-spec: _shape-size-stripper($shape-size);
// Set $G1 as the default fallback color
$first-color: nth($full, 1);
$fallback-color: nth($first-color, 1);
@if (type-of($fallback) == color) or ($fallback == "transparent") {
$fallback-color: $fallback;
}
// Add Commas and spaces
$shape-size: if($shape-size, '#{$shape-size}, ', null);
$pos: if($pos, '#{$pos}, ', null);
$pos-spec: if($pos, 'at #{$pos}', null);
$shape-size-spec: if(($shape-size-spec != ' ') and ($pos == null), '#{$shape-size-spec}, ', '#{$shape-size-spec} ');
background-color: $fallback-color;
t/sass-spec/spec/libsass/bourbon/lib/functions/_linear-gradient.scss view on Meta::CPAN
@function linear-gradient($pos, $gradients...) {
$type: linear;
$pos-type: type-of(nth($pos, 1));
// if $pos doesn't exist, fix $gradient
@if ($pos-type == color) or (nth($pos, 1) == "transparent") {
$gradients: zip($pos $gradients);
$pos: false;
}
$type-gradient: $type, $pos, $gradients;
@return $type-gradient;
}
t/sass-spec/spec/libsass/bourbon/lib/helpers/_radial-arg-parser.scss view on Meta::CPAN
@else if $spec-at-index == 1 {
@for $i from ($spec-at-index + 1) through length($value) {
$pos: $pos nth($value, $i);
}
}
$G1: false;
}
// If not spec calculate correct values
@else {
@if ($pos-type != color) or ($first-val != "transparent") {
@if ($pos-type == number)
or ($first-val == "center")
or ($first-val == "top")
or ($first-val == "right")
or ($first-val == "bottom")
or ($first-val == "left") {
$pos: $value;
@if $pos == $G1 {
t/sass-spec/spec/libsass/color-names/expected.compact.css view on Meta::CPAN
colors { AliceBlue: aliceblue; AntiqueWhite: antiquewhite; Aqua: cyan; Aquamarine: aquamarine; Azure: azure; Beige: beige; Bisque: bisque; Black: black; BlanchedAlmond: blanchedalmond; Blue: blue; BlueViolet: blueviolet; Brown: brown; BurlyWood: burl...
t/sass-spec/spec/libsass/color-names/expected.compressed.css view on Meta::CPAN
colors{AliceBlue:#f0f8ff;AntiqueWhite:#faebd7;Aqua:cyan;Aquamarine:#7fffd4;Azure:azure;Beige:beige;Bisque:bisque;Black:#000;BlanchedAlmond:#ffebcd;Blue:blue;BlueViolet:#8a2be2;Brown:brown;BurlyWood:#deb887;CadetBlue:#5f9ea0;Chartreuse:#7fff00;Chocola...
t/sass-spec/spec/libsass/color-names/expected.expanded.css view on Meta::CPAN
Thistle: thistle;
Tomato: tomato;
Turquoise: turquoise;
Violet: violet;
Wheat: wheat;
White: white;
WhiteSmoke: whitesmoke;
Yellow: yellow;
YellowGreen: yellowgreen;
RebeccaPurple: rebeccapurple;
transparent: transparent;
}
t/sass-spec/spec/libsass/color-names/expected_output.css view on Meta::CPAN
Thistle: thistle;
Tomato: tomato;
Turquoise: turquoise;
Violet: violet;
Wheat: wheat;
White: white;
WhiteSmoke: whitesmoke;
Yellow: yellow;
YellowGreen: yellowgreen;
RebeccaPurple: rebeccapurple;
transparent: transparent; }
t/sass-spec/spec/libsass/color-names/input.scss view on Meta::CPAN
Thistle: #D8BFD8 + 0;
Tomato: #FF6347 + 0;
Turquoise: #40E0D0 + 0;
Violet: #EE82EE + 0;
Wheat: #F5DEB3 + 0;
White: #FFFFFF + 0;
WhiteSmoke: #F5F5F5 + 0;
Yellow: #FFFF00 + 0;
YellowGreen: #9ACD32 + 0;
RebeccaPurple: #663399 + 0;
transparent: transparent + 0;
}