Commit 98058693 by Hampton Catlin

Removing everything that isn't strictly LibSass related

parent 0912e65c
source 'https://rubygems.org'
# Specify your gem's dependencies in sassc.gemspec
gemspec
PATH
remote: .
specs:
sassc (0.0.1)
ffi
rake-compiler
GEM
remote: https://rubygems.org/
specs:
ffi (1.0.11)
rake (0.9.2.2)
rake-compiler (0.8.1)
rake
PLATFORMS
ruby
DEPENDENCIES
sassc!
#!/usr/bin/env rake
#require "bundler/gem_tasks"
#Bundler.setup
load 'sassc.gemspec'
require 'rake/extensiontask'
Rake::ExtensionTask.new do |ext|
ext.name = 'libsass' # indicate the name of the extension.
ext.ext_dir = 'src/' # search for 'hello_world' inside it.
ext.lib_dir = 'lib/sassc' # put binaries into this folder.
#ext.config_script = 'custom_extconf.rb' # use instead of the default 'extconf.rb'.
#ext.tmp_dir = 'tmp' # temporary folder used during compilation.
ext.source_pattern = "*.{c,cpp,hpp}" # monitor file changes to allow simple rebuild.
#ext.config_options << '--with-foo' # supply additional options to configure script.
ext.gem_spec = $gemspec # optionally indicate which gem specification
# will be used.
end
task :run do
require File.expand_path('../lib/sassc', __FILE__)
ptr = SassC::Lib.sass_new_context()
ctx = SassC::Lib::Context.new(ptr)
ctx[:input_string] = SassC::Lib.to_char("hi { width: 30px; }")
puts "!!!" + SassC::Lib.sass_compile(ctx.to_ptr).to_s
#puts ctx[:output_string]
end
\ No newline at end of file
list -> comma_list
-> <nothing>
comma_list -> space_list [',' space_list]*
space_list -> expression expression*
expression -> term [['+' | '-'] term]*
term -> factor [['*' | '/'] factor]*
factor -> percentage | dimension | number | hex |
string_constant | identifier | variable
-> '(' list ')'
a b c d
comma_list
space_list
value
value
value
value
a (b, c) d
comma_list
space_list
value
value
list
comma_list
space_list
value
space_list
value
value
a b, c d
comma_list
space_list
value
value
space_list
value
value
a/b c
list
comma_list
space_list
value
term
division
value
value
value
(a/b)
list
comma_list
space_list
value
list
comma_list
space_list
value
term
division
value
value
\ No newline at end of file
@import url(foobar.css);
div {
a: 2 2 + 2;
a: #{2 + 2};
b: +23;
a: hello #{world};
a: hello whatever;
a: "hello";
b: "hello#{2+2}";
@import url(foobar.css);
c: -webkit-foobar(hux, baz);
c: foo(hello);
@import url(foobar.css);
}
@mixin foo() {
blah: blah;
bloo: bloo;
}
= bar() {
barbar: barboo;
}
div {
+ foo();
a: a;
b: b;
@include foo();
c: c;
+ foo();
d: d;
+ bar;
}
div {
color: blah blah;
*color: blah bloo;
_color: foo boo;
}
\ No newline at end of file
require "./version"
module .
# Your code goes here...
end
module SassC
VERSION = "0.0.1"
end
require File.join(File.dirname(__FILE__), 'sassc/lib')
\ No newline at end of file
#include <stdio.h>
#include "sass_interface.h"
#include <sys/resource.h>
int main(int argc, char** argv)
{
if (argc < 2) {
printf("Hey, I need an input file!\n");
return 0;
}
int who = RUSAGE_SELF;
struct rusage r;
while (1) {
getrusage(who, &r);
printf("Memory usage: %ld\n", r.ru_maxrss);
struct sass_file_context* ctx = sass_new_file_context();
ctx->options.include_paths = "::/blah/bloo/fuzz:/slub/flub/chub::/Users/Aaron/dev/libsass/::::/huzz/buzz:::";
ctx->options.output_style = SASS_STYLE_NESTED;
ctx->input_path = argv[1];
sass_compile_file(ctx);
if (ctx->error_status) {
if (ctx->error_message) printf("%s", ctx->error_message);
else printf("An error occured; no error message available.\n");
sass_free_file_context(ctx);
break;
}
else if (ctx->output_string) {
sass_free_file_context(ctx);
continue;
}
else {
printf("Unknown internal error.\n");
sass_free_file_context(ctx);
break;
}
}
return 0;
}
\ No newline at end of file
#include <stdio.h>
#include "src/sass_interface.h"
int main(int argc, char** argv)
{
if (argc < 2) {
printf("Usage: sassc [INPUT FILE]\n");
return 0;
}
struct sass_file_context* ctx = sass_new_file_context();
ctx->options.include_paths = "";
ctx->options.output_style = SASS_STYLE_NESTED;
ctx->input_path = argv[1];
sass_compile_file(ctx);
if (ctx->error_status) {
if (ctx->error_message) printf("%s", ctx->error_message);
else printf("An error occured; no error message available.\n");
}
else if (ctx->output_string) {
printf("%s", ctx->output_string);
}
else {
printf("Unknown internal error.\n");
}
sass_free_file_context(ctx);
return 0;
}
\ No newline at end of file
# -*- encoding: utf-8 -*-
#require File.expand_path('../lib/sassc', __FILE__)
$gemspec = Gem::Specification.new do |gem|
gem.authors = ["Hampton Catlin", "Aaron Leung"]
gem.email = ["hcatlin@gmail.com"]
gem.description = %q{A native implementation of the Sass language}
gem.summary = %q{Native Sass}
gem.homepage = "http://github.com/hcatlin/libsass"
gem.files = `git ls-files`.split($\)
gem.executables = []#gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = "sassc"
gem.extensions = ["src/extconf.rb"]
gem.require_paths = ["lib", "src"]
gem.version = "0.1"#SassC::VERSION
gem.add_dependency('ffi')
gem.add_dependency('rake-compiler')
end
$x: rgb(255, 0, 0);
div {
color: rgb(255, $blue: 0, $green: 255);
background: rgb(123, 45, 6);
flah: rgba(0, 0, 0, 1) + #111;
grah: rgba($alpha: .5, #fff);
blah: rgba(1,2,3,.6);
floo: $x;
bloo: rgba($x, 0.5);
floo2: $x;
$x: rgb(123, 45, 6);
hoo: red($x);
moo: green($x);
poo: blue($x);
$y: rgba(123, 45, 6, .7);
goo: rgba($y, .8);
hooboo: unquote("hello");
hooboo: unquote(goodbye);
boohoo: quote(floogoo);
boohoo: quote('I said "hello" to you.');
fooboo: quote('whatever and so forth');
a: alpha($y);
b: opacity($y);
c: opacity(#abc);
a: opacify(rgba(0,0,0,0.5), 0.1);
b: fade_in(rgba(0,0,17,0.8), 0.2);
a: transparentize(rgba(0,0,0,0.5), 0.1);
b: fade_out(rgba(0,0,17,0.8), 0.2);
a: percentage(100px / 50px);
a: abs(100px / 50px);
b: round(10.4px);
c: round(10.6px);
d: floor(10.4px);
e: floor(10.6px);
f: ceil(10.4px);
g: ceil(10.6px);
h: abs(-23em);
a: length(10px);
b: length(10px 20 30em);
c: length(());
a: nth(3px, 1);
b: nth((a, b, c), 2);
c: nth(foo bar hux, 3);
a: join(a b c, d e f, "comma");
b: length(join(a b c, d e f, comma));
c: join(10px 20px, 30px 40px);
d: join((), 1 2 3);
e: join(1 2 3, (), comma);
f: join((1,2,3), ());
g: join((), (1,2,3));
h: hello join((),(), auto);
a: type-of(false);
b: type-of("true");
c: type-of(a b c);
a: unit(10);
b: unit(10%);
c: unit(10boo);
d: unitless(20%);
e: unitless(123);
/* comparable tests */
a: comparable(123em, 123cm);
b: comparable(123pt, 123in);
c: comparable(120, 12pt);
d: comparable(10px, 12pt);
e: comparable(10pc, 12%);
f: comparable(2em, 50%);
g: comparable(1.5em, 3ex);
h: comparable(2em, 24pt);
i: comparable(16pt, .5cm);
/* hsl tests */
a: hsl(23, 100%, 50%);
b: hsl(120, 100%, 50%);
/* logical negation */
a: not(false);
b: not(true);
c: not(hello);
d: not("");
/* relational operators */
a: hello == hello;
b: (1 2 3) == (1 2 3);
c: "hello" == hello;
d: 1 + 2 > 3; //false
e: 1 + 2 < 4; //true
f: 1+2*3 >= 6; //true
/* logical connectives */
a: 1 < 2 and 2 < 3;
b: not(true) or not(false);
b: hey or ho or false or hoo;
c: false and hey and ho;
d: true and false and (1/0);
e: (()()()()()()()()25()()()()()()()()()()()()()()()()()()()()()()());
/* e: 1 < 3 and 3 < 5;
f: (1 2 3) and (4 5 6);*/
/* a: 1 < 2;
b: 1 > 2;
c: 1 > 2 or 3 < 4;
d: 1 > 3 and unit(10px);
e: not (false);*/
}
\ No newline at end of file
div {
a: hey and ho and hoo;
b: hey or ho or hoo;
c: hey and false and (1/0);
d: 1 > 2 or 1+3 < 1 or bungle;
e: 1 > 2 or 1 < 2 and fungible;
/* things that aren't logical keywords */
a: hey andalso ho and-come-on hoo;
b: hey orelse ho andalso hoo;
c: hoogoo ! important blah;
d: boogoo !important;
> span {
foo: bar;
hux: blux;
}
}
a {
blah: blah;
f &.b {
blee: blee;
}
}
\ No newline at end of file
$x: 1 2 3;
bobo + mogo {
hey: hoo;
}
@mixin moogoo() {
hey: ho;
div {
blah: blah;
bloo: (1/0) + 5;
}
}
:nth-of-type(2) {
foo: bar;
}
div[hux ~= "hello"] {
hux: blux;
foo: boo;
dux: "hello" + "goodbye";
shux: 'hello' + 12;
frux: 12 + 'hello';
blah: blah;
hoo: blah == 12;
//moo: rgba(0,0,0,.5) + rgba(0,0,0,.6);
moo: rgba(0,0,0,.5) + 3;
}
$y: hey;
@mixin foo($x) {
foofoo: $x $y;
}
div {
@include foo();
hoo: rgba(1, 3, 3, .4);
blah: fade_out(#123, 1px);
flah: unquote("hello");
grah: quote(hello);
hrah: quote(mukluk);
mwah: join((), 2, "comma");
gwah: comparable(foo, bar);
}
\ No newline at end of file
div {
p01: #abc;
p02: #aabbcc;
p03: #abc + hello;
p04: #abc + 1; // add 1 to each triplet
p05: #abc + #001; // triplet-wise addition
p06: #0000ff + 1; // add 1 to each triplet; ignore overflow because it doesn't correspond to a color name
p07: #0000ff + #000001; // convert overflow to name of color (blue)
p08: #00ffff + #000101; // aqua
p09: #000000;
p10: #000000 - 1; // black
p11: #000000 - #000001; // black
p12: #ffff00 + #010100; // yellow
p13: (#101010 / 7);
p14: #000 + 0;
p15: 10 - #222;
p16: #000 - #001;
p17: #f0f + #101;
p18: 10 #222 + 1;
p19: (10 / #222);
p20: rgb(10,10,10) + #010001;
p21: #010000 + rgb(255, 255, 255);
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
$x: bar;
$blux: inside blux;
div {
a: blah foo#{$x};
b: (1#{2+3}) + 4;
b: (1 (2+3)) + 4;
c: 1#{2 + 3} + 4;
d: type-of(false);
e: type-of(fa#{lse});
e: 12fa#{lse}345;
f: 12+#{3}, 12(#{3});
g: (12)34, 12(34);
h: #fff#{f};
j: $bl#{ux};
}
\ No newline at end of file
$stuff: 1 2 3;
$three: 3;
div {
a: 1 + 2;
b: 3 + 3/4;
c: 1/2 + 1/2;
/* shouldn't eval the following "300" */
d: 300;
/* increasingly jacked-up edge cases that combine arithmetic with lists */
e: 1 + (5/10 2 3);
f: 1 + ((2+(3 4) 5) 6);
g: 1 + ((1+(14/7 8) 9) 6);
/* shouldn't perform the following division */
h: 15 / 3 / 5;
/* should perform the following division now */
i: (15 / 3 / 5);
/* this too */
j: (15 / 3) / 5;
/* and this */
k: 15 / $three;
l: 15 / 5 / $three;
m: 1/2, $stuff;
n: 1 2 3, $stuff 4 5 (6, 7 8 9);
o: 3px + 3px;
p: 4 + 1em;
q: (20pt / 10pt);
r: 16em * 4;
s: (5em / 2);
t: 1 + (2 + (3/4 + (4/5 6/7)));
}
\ No newline at end of file
$x: global-x;
$y: global-y;
$z: global-z;
@mixin foo($x, $y) {
margin: $x $y;
blip {
hey: now;
}
}
@mixin foogoo($x, $y, $z) {
margin: $x $y $z;
}
@mixin hux($y) {
color: $y;
@include foo(called-from-hux);
}
div {
@include foo(1, 2);
@include foo(1);
@include foogoo(1, 2);
@include foogoo($y: kwd-y, $z: kwd-z);
}
div {
@include hux();
}
$y: different-global-y;
div {
@include hux(calling-hux-again);
}
@mixin bung() {
blah: original-bung;
}
div {
@include bung();
}
@mixin bung() {
blah: redefined-bung;
}
div {
@include bung();
}
div {
@include bung;
}
div {
@include foo(arg1, arg2, $x: kwdarg1, $y: kwdarg2);
@include foo($x: kwdarg1, $y: kwdarg2, arg1, arg2);
}
@mixin ruleset() {
moo: goo;
hoo {
color: boo;
}
}
@include ruleset();
$da: default argument;
@mixin default_args($x, $y: $da) {
blah: $x $y;
}
$da: some other default;
div {
@include default_args(boogoo);
}
@mixin original() {
value: original;
}
div {
@include original();
}
@mixin original() {
value: no longer original;
}
div {
@include original();
}
@mixin set-x($x) {
$x: changed local x;
arg: $x;
$y: changed global y;
blarg: $y;
}
div {
@include set-x(blah);
a: $x;
b: $y;
}
\ No newline at end of file
$blah: bloo blee;
$blip: "a 'red' and \"blue\" value";
/* top level comment -- should be preserved */
div {
/* another comment that should be preserved */
color: gray;
background: blue;
$blux: hux; // gone!
span {
font-weight: bold;
a {
text-decoration: none; /* where will this comment go? */
color: green;
/* what about this comment? */ border: 1px $blah red;
};;
/* yet another comment that should be preserved */
display: inline-block;
} // gone!
/* the next selector should be indented two spaces */
empty {
not_empty {
blah: blah; // gone!
bloo: bloo // the last rule in a block may omit the semicolon
}
}
p {
padding: 10px 8%;
arithmetic: 1 + 2 * 3 / 4;
hex-arithmetic: #abcdef + 1;
-webkit-box-sizing: $blux; ; ;
; ; ;;;
}
margin: 10px 5px;
h1 {
color: $blip;
}
}
/* last comment, top level again --
compare the indentation! */
div {
f: g;
empty {
span {
a: b;
}
}
empty_with_comment {
/* hey now */
span {
c: d;
}
}
}
\ No newline at end of file
#include <iostream>
#include "testlib.hpp"
namespace TestLib {
using std::cout;
using std::endl;
extern const char HELLO[] = "Hello, world!";
template <const char *str>
void msg() {
cout << str << endl;
}
}
void say_hello() {
TestLib::msg<TestLib::HELLO>();
}
\ No newline at end of file
void say_hello();
\ No newline at end of file
extern "C" void say_hello();
\ No newline at end of file
#include "testlib.h"
int main() {
say_hello();
say_hello();
return 0;
}
\ No newline at end of file
#include "testlib.hpp"
int main() {
say_hello();
return 0;
}
\ No newline at end of file
#!/usr/bin/env ruby
searchpath = ARGV[0]
messages = []
worked = 0
spec_count = 0
puts("Running tests in #{searchpath}..\n\n")
Dir[File.join(searchpath + "***/input.*")].each do |input_file|
spec_count += 1
spec_dir = File.dirname(input_file)
cmd = "./bin/sassc #{input_file}"
#puts cmd
output = `#{cmd}`
sass_output = `sass #{input_file}`
expected_output = File.read(File.join(spec_dir, "output.css"))
if expected_output.strip != sass_output.strip
puts "Problem with Ruby compat in #{input_file}"
end
if output.strip != expected_output.strip
print "F"
messages << "Failed test #{spec_dir}"
else
worked += 1
print "."
end
end
puts("\n\n#{worked}/#{spec_count} Specs Passed!")
if messages.length > 0
puts("\n================================\nTEST FAILURES!\n\n")
puts(messages.join("\n-----------\n"))
puts("\n")
exit(1)
else
puts("YOUWIN!")
exit(0)
end
a {
color: blue;
}
\ No newline at end of file
a {
color: blue; }
\ No newline at end of file
div {
img {
border: 0px;
}
}
\ No newline at end of file
div img {
border: 0px; }
\ No newline at end of file
$color: red;
a {
color: $color;
}
\ No newline at end of file
a {
color: red; }
\ No newline at end of file
$color: "black";
$color: red;
$background: "blue";
a {
color: $color;
background: $background;
}
$y: before;
$x: 1 2 $y;
foo {
a: $x;
}
$y: after;
foo {
a: $x;
}
\ No newline at end of file
a {
color: red;
background: "blue"; }
foo {
a: 1 2 before; }
foo {
a: 1 2 before; }
div {
span {
color: red;
background: blue;
}
}
div {
color: gray;
empty {
span {
color: red;
background: blue;
}
}
}
empty1 {
empty2 {
div {
blah: blah;
}
}
}
empty1 {
empty2 {
div {
bloo: blee;
empty3 {
span {
blah: blah;
blah: blah;
}
}
}
}
}
div span {
color: red;
background: blue; }
div {
color: gray; }
div empty span {
color: red;
background: blue; }
empty1 empty2 div {
blah: blah; }
empty1 empty2 div {
bloo: blee; }
empty1 empty2 div empty3 span {
blah: blah;
blah: blah; }
$blah: bloo blee;
$blip: "a 'red' and \"blue\" value";
/* top level comment -- should be preserved */
div {
/* another comment that should be preserved */
color: red;
background: blue;
$blux: hux; // gone!
span {
font-weight: bold;
a {
text-decoration: none; /* where will this comment go? */
color: green;
/* what about this comment? */ border: 1px $blah red;
}
/* yet another comment that should be preserved */
display: inline-block;
} // gone!
/* the next selector should be indented two spaces */
empty {
not_empty {
blah: blah; // gone!
bloo: bloo;
}
}
p {
padding: 10px 8%;
-webkit-box-sizing: $blux;
}
margin: 10px 5px;
h1 {
color: $blip;
}
}
/* last comment, top level again --
compare the indentation! */
div {
f: g;
empty {
span {
a: b;
}
}
empty_with_comment {
/* hey now */
span {
c: d;
}
}
}
\ No newline at end of file
/* top level comment -- should be preserved */
div {
/* another comment that should be preserved */
color: red;
background: blue;
/* the next selector should be indented two spaces */
margin: 10px 5px; }
div span {
font-weight: bold;
/* yet another comment that should be preserved */
display: inline-block; }
div span a {
text-decoration: none;
/* where will this comment go? */
color: green;
/* what about this comment? */
border: 1px bloo blee red; }
div empty not_empty {
blah: blah;
bloo: bloo; }
div p {
padding: 10px 8%;
-webkit-box-sizing: hux; }
div h1 {
color: "a 'red' and \"blue\" value"; }
/* last comment, top level again --
compare the indentation! */
div {
f: g; }
div empty span {
a: b; }
div empty_with_comment {
/* hey now */ }
div empty_with_comment span {
c: d; }
a, b {
color: red;
background: blue;
}
c, d {
color: gray;
e, f {
background: blue;
padding: 10px 5px;
}
g, h {
blah: blah;
bloo: bloo;
}
i, j {
foo: goo;
k, l {
m, n, o {
wow: we are far inside;
but: it still works;
}
hoo: boo;
}
}
}
\ No newline at end of file
a, b {
color: red;
background: blue; }
c, d {
color: gray; }
c e, c f, d e, d f {
background: blue;
padding: 10px 5px; }
c g, c h, d g, d h {
blah: blah;
bloo: bloo; }
c i, c j, d i, d j {
foo: goo; }
c i k, c i l, c j k, c j l, d i k, d i l, d j k, d j l {
hoo: boo; }
c i k m, c i k n, c i k o, c i l m, c i l n, c i l o, c j k m, c j k n, c j k o, c j l m, c j l n, c j l o, d i k m, d i k n, d i k o, d i l m, d i l n, d i l o, d j k m, d j k n, d j k o, d j l m, d j l n, d j l o {
wow: we are far inside;
but: it still works; }
a + b > c {
d e {
color: blue;
background: white;
}
color: red;
background: gray;
}
\ No newline at end of file
a + b > c {
color: red;
background: gray; }
a + b > c d e {
color: blue;
background: white; }
a + b, c {
blah: blah;
bleh: bleh;
d e, f ~ g + h, > i {
bloo: bloo;
blee: blee;
}
}
\ No newline at end of file
a + b, c {
blah: blah;
bleh: bleh; }
a + b d e, a + b f ~ g + h, a + b > i, c d e, c f ~ g + h, c > i {
bloo: bloo;
blee: blee; }
a + b, .class {
blah: blah;
bleh: bleh;
d #id, f ~ g.other + h, > i#grar {
bloo: bloo;
blee: blee;
}
}
\ No newline at end of file
a + b, .class {
blah: blah;
bleh: bleh; }
a + b d #id, a + b f ~ g.other + h, a + b > i#grar, .class d #id, .class f ~ g.other + h, .class > i#grar {
bloo: bloo;
blee: blee; }
[hey = 'ho'], a > b {
blah: blah;
c, [hoo *= "ha" ] {
bloo: bloo;
}
}
\ No newline at end of file
[hey='ho'], a > b {
blah: blah; }
[hey='ho'] c, [hey='ho'] [hoo*="ha"], a > b c, a > b [hoo*="ha"] {
bloo: bloo; }
a b {
color: red;
:first-child, :nth-of-type( -2n+1 ) {
.foo#bar:nth-child(even) {
hoo: goo;
}
blah: bloo;
::after {
content: "glux";
color: green;
}
:not(.foo) {
hoo: boo;
}
// the following is not actually valid, but sass accepts it
:not(:not(:not(.foo[bleeble="blabble"] > .hello, .gluxbux))) { hoo: boo; }
a { b: c; }
}
}
\ No newline at end of file
Original Sass and libsass can produce different output for functional pseudo-classes. Original Sass does not normalize whitespace contained within an expression, and it also accepts invalid expressions. Libsass is stricter, and removes superfluous whitespace. E.g., on the following selector:
nth-child( 2n + 3 )
Original Sass produces:
nth-child(2n + 3)
whereas libsass produces:
nth-child(2n+3)
\ No newline at end of file
a b {
color: red; }
a b :first-child, a b :nth-of-type(-2n+1) {
blah: bloo; }
a b :first-child .foo#bar:nth-child(even), a b :nth-of-type(-2n+1) .foo#bar:nth-child(even) {
hoo: goo; }
a b :first-child ::after, a b :nth-of-type(-2n+1) ::after {
content: "glux";
color: green; }
a b :first-child :not(.foo), a b :nth-of-type(-2n+1) :not(.foo) {
hoo: boo; }
a b :first-child :not(:not(:not(.foo[bleeble="blabble"] > .hello, .gluxbux))), a b :nth-of-type(-2n+1) :not(:not(:not(.foo[bleeble="blabble"] > .hello, .gluxbux))) {
hoo: boo; }
a b :first-child a, a b :nth-of-type(-2n+1) a {
b: c; }
hey, ho {
& > boo, foo &.goo {
bloo: bloo;
}
blah: blah;
}
\ No newline at end of file
hey, ho {
blah: blah; }
hey > boo, foo hey.goo, ho > boo, foo ho.goo {
bloo: bloo; }
div {
span {
moo: goo;
}
}
$x: boo;
\ No newline at end of file
hoo {
mux: scooba-dee-doo;
flux: gooboo $x;
@import "d.scss";
}
\ No newline at end of file
d {
inside: d now;
}
\ No newline at end of file
@import "a.scss";
foo {
blah: blah;
goo {
blee: blee;
@import "../14_imports/b.scss";
hello: world;
}
@import "sub/c.scss";
}
\ No newline at end of file
div span {
moo: goo; }
foo {
blah: blah; }
foo goo {
blee: blee;
hello: world; }
foo goo hoo {
mux: scooba-dee-doo;
flux: gooboo boo; }
foo goo hoo d {
inside: d now; }
foo blux {
hey: another thing;
ho: will this work; }
blux {
hey: another thing;
ho: will this work;
}
\ No newline at end of file
$stuff: 1 2 3;
$three: 3;
div {
a: 1 + 2;
b: 3 + 3/4;
c: 1/2 + 1/2;
/* shouldn't eval the following "300" */
d: 300;
/* increasingly jacked-up edge cases that combine arithmetic with lists */
e: 1 + (5/10 2 3);
f: 1 + ((2+(3 4) 5) 6);
g: 1 + ((1+(14/7 8) 9) 6);
/* shouldn't perform the following division */
h: 15 / 3 / 5;
/* should perform the following division now */
i: (15 / 3 / 5);
/* this too */
j: (15 / 3) / 5;
/* and this */
k: 15 / $three;
l: 15 / 5 / $three;
m: 1/2, $stuff url("www.foo.com/blah.png") blah blah;
n: 1 2 3, $stuff 4 5 (6, 7 8 9);
o: 3px + 3px + 3px;
p: 4 + 1px;
q: (20pt / 10pt);
r: 16em * 4;
s: (5em / 2);
t: 1 + (2 + (3/4 + (4/5 6/7)));
}
\ No newline at end of file
div {
a: 3;
b: 3.75;
c: 1;
/* shouldn't eval the following "300" */
d: 300;
/* increasingly jacked-up edge cases that combine arithmetic with lists */
e: 10.5 2 3;
f: 123 4 5 6;
g: 112 8 9 6;
/* shouldn't perform the following division */
h: 15/3/5;
/* should perform the following division now */
i: 1;
/* this too */
j: 1;
/* and this */
k: 5;
l: 1;
m: 1/2, 1 2 3 url("www.foo.com/blah.png") blah blah;
n: 1 2 3, 1 2 3 4 5 6, 7 8 9;
o: 9px;
p: 5px;
q: 2;
r: 64em;
s: 2.5em;
t: 120.750.8 6/7; }
div {
p01: #abc;
p02: #aabbcc;
p03: #abc + hello;
p04: #abc + 1; // add 1 to each triplet
p05: #abc + #001; // triplet-wise addition
p06: #0000ff + 1; // add 1 to each triplet; ignore overflow because it doesn't correspond to a color name
p07: #0000ff + #000001; // convert overflow to name of color (blue)
p08: #00ffff + #000101; // aqua
p09: #000000;
p10: #000000 - 1; // black
p11: #000000 - #000001; // black
p12: #ffff00 + #010100; // yellow
p13: (#101010 / 7);
p14: #000 + 0;
p15: 10 - #222;
p16: #000 - #001;
p17: #f0f + #101;
p18: 10 #222 + 1;
p19: (10 / #222);
p20: rgb(10,10,10) + #010001;
p21: #010000 + rgb(255, 255, 255);
}
\ No newline at end of file
div {
p01: #abc;
p02: #aabbcc;
p03: #aabbcchello;
p04: #abbccd;
p05: #aabbdd;
p06: #0101ff;
p07: blue;
p08: aqua;
p09: #000000;
p10: black;
p11: black;
p12: yellow;
p13: #020202;
p14: black;
p15: 10-#222222;
p16: black;
p17: fuchsia;
p18: 10 #232323;
p19: 10/#222222;
p20: #0b0a0b;
p21: white; }
@mixin foo($x, $y) {
hugabug: $y $x;
}
@mixin bar($a, $b: flug) {
flugablug: $a $b glug;
}
@mixin hux() {
no: parameters here;
div, span {
some: nested stuff;
foo, bar {
more: stuff so forth;
blah: blah;
}
}
/* end of hux */
}
a {
hey: ho;
@include foo($x: kwd-arg another-kwd-arg, second, third);
@include foo(eks, why, $x: kwd-eks);
@include foo($y: kwd-y, $x: kwd-x);
goo: boo hoo;
@include hux;
@include bar(pug);
@include bar(pug, mug);
}
$x: from a variable;
div {
blah: blah $x blah;
}
\ No newline at end of file
a {
hey: ho;
hugabug: third second;
hugabug: why eks;
hugabug: kwd-y kwd-x;
goo: boo hoo;
no: parameters here;
/* end of hux */
flugablug: pug flug glug;
flugablug: pug mug glug; }
a div, a span {
some: nested stuff; }
a div foo, a div bar, a span foo, a span bar {
more: stuff so forth;
blah: blah; }
div {
blah: blah from a variable blah; }
$x: global x;
$y: global y;
@mixin foo($x) {
f-a: $x;
f-b: $y;
$x: local x changed by foo;
$y: global y changed by foo;
$z: new local z;
f-a: $x;
f-b: $y;
f-c: $z;
}
div {
a: $x;
b: $y;
@include foo(arg);
a: $x;
b: $y;
}
\ No newline at end of file
div {
a: global x;
b: global y;
f-a: arg;
f-b: global y;
f-a: local x changed by foo;
f-b: global y changed by foo;
f-c: new local z;
a: global x;
b: global y changed by foo; }
$x: global-x;
$y: global-y;
$z: global-z;
@mixin foo($x, $y) {
/* begin foo */
margin: $x $y;
blip {
hey: now;
}
/* end foo */
}
@mixin foogoo($x, $y, $z) {
margin: $x $y $z;
}
@mixin hux($y) {
/* begin hux */
color: $y;
@include foo(called-from-hux);
/* end hux */
}
div {
@include foo(1, 2);
@include foo(1);
@include foogoo(1, 2);
@include foogoo($y /* blah */ : kwd-y, $z: kwd-z);
}
div {
@include hux();
}
$y: different-global-y;
div {
@include hux(calling-hux-again);
}
@mixin bung() {
blah: original-bung;
}
div {
@include bung();
}
@mixin bung() {
blah: redefined-bung;
}
div {
@include bung();
}
div {
/* calls to nullary mixins may omit the empty argument list */
@include bung;
}
div {
@include foo(arg1, arg2, $x: kwdarg1, $y: kwdarg2);
@include foo($x: kwdarg1, $y: kwdarg2, arg1, arg2);
}
@mixin ruleset() {
hoo {
color: boo;
}
}
@include ruleset();
$da: default argument;
@mixin default_args($x, $y: $da) {
blah: $x $y;
}
$da: some other default;
div {
@include default_args(boogoo);
}
@mixin original() {
value: original;
}
div {
@include original();
}
@mixin original() {
value: no longer original;
}
div {
@include original();
}
@mixin set-x($x) {
$x: changed local x;
arg: $x;
$y: changed global y;
blarg: $y;
}
div {
@include set-x(blah);
a: $x;
b: $y;
}
\ No newline at end of file
div {
/* begin foo */
margin: 1 2;
/* end foo */
/* begin foo */
margin: 1 global-y;
/* end foo */
margin: 1 2 global-z;
margin: global-x kwd-y kwd-z; }
div blip {
hey: now; }
div blip {
hey: now; }
div {
/* begin hux */
color: global-y;
/* begin foo */
margin: called-from-hux global-y;
/* end foo */
/* end hux */ }
div blip {
hey: now; }
div {
/* begin hux */
color: calling-hux-again;
/* begin foo */
margin: called-from-hux different-global-y;
/* end foo */
/* end hux */ }
div blip {
hey: now; }
div {
blah: original-bung; }
div {
blah: redefined-bung; }
div {
/* calls to nullary mixins may omit the empty argument list */
blah: redefined-bung; }
div {
/* begin foo */
margin: arg1 arg2;
/* end foo */
/* begin foo */
margin: arg1 arg2;
/* end foo */ }
div blip {
hey: now; }
div blip {
hey: now; }
hoo {
color: boo; }
div {
blah: boogoo some other default; }
div {
value: original; }
div {
value: no longer original; }
div {
arg: changed local x;
blarg: changed global y;
a: global-x;
b: changed global y; }
@mixin foo() {
/* begin foo */
/* assigning to $x */
$x: inside foo;
x: $x;
/* end foo */
}
outer {
/* assigning to $x */
$x: inside outer scope;
blah: blah;
inner {
@include foo();
x: $x;
}
}
\ No newline at end of file
outer {
/* assigning to $x */
blah: blah; }
outer inner {
/* begin foo */
/* assigning to $x */
x: inside foo;
/* end foo */
x: inside outer scope; }
div {
color: rgb(255, $blue: 0, $green: 255);
background: rgb(123, 45, 6);
}
div {
color: yellow;
background: #7b2d06; }
$x: rgb(0, 255, 255);
div {
color: rgb(255, $blue: 0, $green: 255);
background: rgb(123, 45, 6);
flah: rgba(0, 0, 0, 1) + #111;
grah: rgba($alpha: .5, #f0e);
blah: rgba(1,2,3,.6);
floo: $x;
bloo: rgba($x, 0.7);
groo: $x;
$x: rgb(123, 45, 6);
hoo: red($x);
moo: green($x);
poo: blue($x);
roo: mix(#f00, #00f);
doo: mix(#f00, #00f, 25%);
goo: mix(rgba(255, 0, 0, 0.5), #00f);
boo: invert(#123456);
}
div {
color: yellow;
background: #7b2d06;
flah: #111111;
grah: rgba(255, 0, 238, 0.5);
blah: rgba(1, 2, 3, 0.6);
floo: aqua;
bloo: rgba(0, 255, 255, 0.7);
groo: aqua;
hoo: 123;
moo: 45;
poo: 6;
roo: #7f007f;
doo: #3f00bf;
goo: rgba(63, 0, 191, 0.75);
boo: #edcba9; }
div {
a: hello#{world};
a: hello #{world};
b: 12#{3};
b: type-of(12#{3});
b: #{12 + 111};
b: type-of(#{12 + 111});
}
\ No newline at end of file
div {
a: helloworld;
a: hello world;
b: 123;
b: string;
b: 123;
b: string; }
This source diff could not be displayed because it is too large. You can view the blob instead.
foo {
bar:baz:bang:bop:biddle:woo:look:at:all:these:pseudoclasses {a: b};
bar:baz bang bop biddle woo look at all these elems {a: b};
bar:baz bang bop biddle woo look at all these elems; }
foo {
bar: baz bang bop biddle woo look at all these elems; }
foo bar:baz:bang:bop:biddle:woo:look:at:all:these:pseudoclasses {
a: b; }
foo bar:baz bang bop biddle woo look at all these elems {
a: b; }
@mixin foo {a: b}
bar {
@include foo;
c: d; }
foo {
bar: baz; }
bar {
bar: baz; }
baz {
bar: baz; }
foo {
bar: baz; }
bar {
bar: baz; }
baz {
bar: baz; }
/* This is a CSS comment. */
.one {
color: green; }
/* Another comment */
/* The following should not be used:
.two {color: red;} */
.three {
color: green;
/* color: red; */ }
/**
.four {color: red;} */
.five {
color: green; }
/**/
.six {
color: green; }
/*********/
.seven {
color: green; }
/* a comment **/
.eight {
color: green; }
/* This is a CSS comment. */
.one {
color: green; }
/* Another comment */
/* The following should not be used:
.two {color: red;} */
.three {
color: green;
/* color: red; */ }
/**
.four {color: red;} */
.five {
color: green; }
/**/
.six {
color: green; }
/*********/
.seven {
color: green; }
/* a comment **/
.eight {
color: green; }
@import url(foo.css);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment