Skip to content

Instantly share code, notes, and snippets.

@spanuska
Created August 31, 2016 18:08
Show Gist options
  • Save spanuska/7d3bc2c97a632d862ae696161fdb6088 to your computer and use it in GitHub Desktop.
Save spanuska/7d3bc2c97a632d862ae696161fdb6088 to your computer and use it in GitHub Desktop.
example_tree = [
{:node=>:at_rule,
:name=>"charset",
:prelude=>[{:node=>:whitespace, :pos=>8, :raw=>" "}, {:node=>:string, :pos=>9, :raw=>"\"UTF-8\"", :value=>"UTF-8"}],
:tokens=>
[{:node=>:at_keyword, :pos=>0, :raw=>"@charset", :value=>"charset"},
{:node=>:whitespace, :pos=>8, :raw=>" "},
{:node=>:string, :pos=>9, :raw=>"\"UTF-8\"", :value=>"UTF-8"},
{:node=>:semicolon, :pos=>16, :raw=>";"}]},
{:node=>:style_rule,
:selector=>{:node=>:selector,
:value=>"html",
:tokens=>[{
:node=>:ident,
:pos=>77,
:raw=>"html",
:value=>"html"}]
},
:children=>
[{:node=>:property,
:name=>"font-family",
:value=>"sans-serif",
:children=>[{:node=>:ident, :pos=>94, :raw=>"sans-serif", :value=>"sans-serif"}],
:important=>false,
:tokens=>
[{:node=>:ident, :pos=>82, :raw=>"font-family", :value=>"font-family"},
{:node=>:colon, :pos=>93, :raw=>":"},
{:node=>:ident, :pos=>94, :raw=>"sans-serif", :value=>"sans-serif"}]},
{:node=>:semicolon, :pos=>104, :raw=>";"},
{:node=>:property,
:name=>"-ms-text-size-adjust",
:value=>"100%",
:children=>[{:node=>:percentage, :pos=>126, :raw=>"100%", :repr=>"100", :type=>:integer, :value=>100}],
:important=>false,
:tokens=>
[{:node=>:ident, :pos=>105, :raw=>"-ms-text-size-adjust", :value=>"-ms-text-size-adjust"},
{:node=>:colon, :pos=>125, :raw=>":"},
{:node=>:percentage, :pos=>126, :raw=>"100%", :repr=>"100", :type=>:integer, :value=>100}]},
{:node=>:semicolon, :pos=>130, :raw=>";"},
{:node=>:property,
:name=>"-webkit-text-size-adjust",
:value=>"100%",
:children=>[{:node=>:percentage, :pos=>156, :raw=>"100%", :repr=>"100", :type=>:integer, :value=>100}],
:important=>false,
:tokens=>
[{:node=>:ident, :pos=>131, :raw=>"-webkit-text-size-adjust", :value=>"-webkit-text-size-adjust"},
{:node=>:colon, :pos=>155, :raw=>":"},
{:node=>:percentage, :pos=>156, :raw=>"100%", :repr=>"100", :type=>:integer, :value=>100}]}]},
{:node=>:style_rule,
:selector=>{:node=>:selector, :value=>"body", :tokens=>[{:node=>:ident, :pos=>161, :raw=>"body", :value=>"body"}]},
:children=>
[{:node=>:property,
:name=>"margin",
:value=>"0",
:children=>[{:node=>:number, :pos=>173, :raw=>"0", :repr=>"0", :type=>:integer, :value=>0}],
:important=>false,
:tokens=>
[{:node=>:ident, :pos=>166, :raw=>"margin", :value=>"margin"},
{:node=>:colon, :pos=>172, :raw=>":"},
{:node=>:number, :pos=>173, :raw=>"0", :repr=>"0", :type=>:integer, :value=>0}]}]},
{:node=>:style_rule,
:selector=>
{:node=>:selector,
:value=>"article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary",
:tokens=>
[{:node=>:ident, :pos=>175, :raw=>"article", :value=>"article"},
{:node=>:comma, :pos=>182, :raw=>","},
{:node=>:ident, :pos=>183, :raw=>"aside", :value=>"aside"},
{:node=>:comma, :pos=>188, :raw=>","},
{:node=>:ident, :pos=>189, :raw=>"details", :value=>"details"},
{:node=>:comma, :pos=>196, :raw=>","},
{:node=>:ident, :pos=>197, :raw=>"figcaption", :value=>"figcaption"},
{:node=>:comma, :pos=>207, :raw=>","},
{:node=>:ident, :pos=>208, :raw=>"figure", :value=>"figure"},
{:node=>:comma, :pos=>214, :raw=>","},
{:node=>:ident, :pos=>215, :raw=>"footer", :value=>"footer"},
{:node=>:comma, :pos=>221, :raw=>","},
{:node=>:ident, :pos=>222, :raw=>"header", :value=>"header"},
{:node=>:comma, :pos=>228, :raw=>","},
{:node=>:ident, :pos=>229, :raw=>"hgroup", :value=>"hgroup"},
{:node=>:comma, :pos=>235, :raw=>","},
{:node=>:ident, :pos=>236, :raw=>"main", :value=>"main"},
{:node=>:comma, :pos=>240, :raw=>","},
{:node=>:ident, :pos=>241, :raw=>"nav", :value=>"nav"},
{:node=>:comma, :pos=>244, :raw=>","},
{:node=>:ident, :pos=>245, :raw=>"section", :value=>"section"},
{:node=>:comma, :pos=>252, :raw=>","},
{:node=>:ident, :pos=>253, :raw=>"summary", :value=>"summary"}]},
:children=>
[{:node=>:property,
:name=>"display",
:value=>"block",
:children=>[{:node=>:ident, :pos=>269, :raw=>"block", :value=>"block"}],
:important=>false,
:tokens=>
[{:node=>:ident, :pos=>261, :raw=>"display", :value=>"display"},
{:node=>:colon, :pos=>268, :raw=>":"},
{:node=>:ident, :pos=>269, :raw=>"block", :value=>"block"}]}]},
{:node=>:style_rule, # this one has http
:selector=>
{:node=>:selector,
:value=>".footer .footer-bottom-container",
:tokens=>
[{:node=>:delim, :pos=>0, :raw=>".", :value=>"."},
{:node=>:ident, :pos=>1, :raw=>"footer", :value=>"footer"},
{:node=>:whitespace, :pos=>7, :raw=>" "},
{:node=>:delim, :pos=>8, :raw=>".", :value=>"."},
{:node=>:ident, :pos=>9, :raw=>"footer-bottom-container", :value=>"footer-bottom-container"},
{:node=>:whitespace, :pos=>32, :raw=>" "}]},
:children=>
[{:node=>:whitespace, :pos=>34, :raw=>"\n "},
{:node=>:property,
:name=>"background-image",
:value=>"url(\"http://demandware.edgesuite.net/aayf_prd/on/demandware.static/-/Library-Sites-Nixon/default/dw10a90908/global/JON_ROSE-TUNNEL_footer_1280x482.jpg\")",
:children=>
[{:node=>:whitespace, :pos=>54, :raw=>" "},
{:node=>:function,
:name=>"url",
:value=>
[{:node=>:string,
:pos=>59,
:raw=>"\"http://demandware.edgesuite.net/aayf_prd/on/demandware.static/-/Library-Sites-Nixon/default/dw10a90908/global/JON_ROSE-TUNNEL_footer_1280x482.jpg\"",
:value=>"http://demandware.edgesuite.net/aayf_prd/on/demandware.static/-/Library-Sites-Nixon/default/dw10a90908/global/JON_ROSE-TUNNEL_footer_1280x482.jpg"}],
:tokens=>
[{:node=>:function, :pos=>55, :raw=>"url(", :value=>"url"},
{:node=>:string,
:pos=>59,
:raw=>"\"http://demandware.edgesuite.net/aayf_prd/on/demandware.static/-/Library-Sites-Nixon/default/dw10a90908/global/JON_ROSE-TUNNEL_footer_1280x482.jpg\"",
:value=>"http://demandware.edgesuite.net/aayf_prd/on/demandware.static/-/Library-Sites-Nixon/default/dw10a90908/global/JON_ROSE-TUNNEL_footer_1280x482.jpg"},
{:node=>:")", :pos=>206, :raw=>")"}]}],
:important=>false,
:tokens=>
[{:node=>:ident, :pos=>37, :raw=>"background-image", :value=>"background-image"},
{:node=>:colon, :pos=>53, :raw=>":"},
{:node=>:whitespace, :pos=>54, :raw=>" "},
{:node=>:function,
:name=>"url",
:value=>
[{:node=>:string,
:pos=>59,
:raw=>"\"http://demandware.edgesuite.net/aayf_prd/on/demandware.static/-/Library-Sites-Nixon/default/dw10a90908/global/JON_ROSE-TUNNEL_footer_1280x482.jpg\"",
:value=>"http://demandware.edgesuite.net/aayf_prd/on/demandware.static/-/Library-Sites-Nixon/default/dw10a90908/global/JON_ROSE-TUNNEL_footer_1280x482.jpg"}],
:tokens=>
[{:node=>:function, :pos=>55, :raw=>"url(", :value=>"url"},
{:node=>:string,
:pos=>59,
:raw=>"\"http://demandware.edgesuite.net/aayf_prd/on/demandware.static/-/Library-Sites-Nixon/default/dw10a90908/global/JON_ROSE-TUNNEL_footer_1280x482.jpg\"",
:value=>"http://demandware.edgesuite.net/aayf_prd/on/demandware.static/-/Library-Sites-Nixon/default/dw10a90908/global/JON_ROSE-TUNNEL_footer_1280x482.jpg"},
{:node=>:")", :pos=>206, :raw=>")"}]}]},
{:node=>:semicolon, :pos=>207, :raw=>";"},
{:node=>:whitespace, :pos=>208, :raw=>"\n"}]},
{:node=>:style_rule,
:selector=>
{:node=>:selector,
:value=>".flag-icon-us",
:tokens=>
[{:node=>:delim, :pos=>0, :raw=>".", :value=>"."},
{:node=>:ident, :pos=>1, :raw=>"flag-icon-us", :value=>"flag-icon-us"},
{:node=>:whitespace, :pos=>13, :raw=>" "}]},
:children=>
[{:node=>:whitespace, :pos=>15, :raw=>"\n "},
{:node=>:property,
:name=>"background-image",
:value=>"url(http://demandware.edgesuite.net/aayf_prd/on/demandware.static/Sites-US-Site/-/en_US/v1463090256663/css/flags/4x3/us.svg)",
:children=>
[{:node=>:whitespace, :pos=>35, :raw=>" "},
{:node=>:url,
:pos=>36,
:raw=>"url(http://demandware.edgesuite.net/aayf_prd/on/demandware.static/Sites-US-Site/-/en_US/v1463090256663/css/flags/4x3/us.svg)",
:value=>"http://demandware.edgesuite.net/aayf_prd/on/demandware.static/Sites-US-Site/-/en_US/v1463090256663/css/flags/4x3/us.svg"}],
:important=>false,
:tokens=>
[{:node=>:ident, :pos=>18, :raw=>"background-image", :value=>"background-image"},
{:node=>:colon, :pos=>34, :raw=>":"},
{:node=>:whitespace, :pos=>35, :raw=>" "},
{:node=>:url,
:pos=>36,
:raw=>"url(http://demandware.edgesuite.net/aayf_prd/on/demandware.static/Sites-US-Site/-/en_US/v1463090256663/css/flags/4x3/us.svg)",
:value=>"http://demandware.edgesuite.net/aayf_prd/on/demandware.static/Sites-US-Site/-/en_US/v1463090256663/css/flags/4x3/us.svg"}]},
{:node=>:semicolon, :pos=>160, :raw=>";"},
{:node=>:whitespace, :pos=>161, :raw=>"\n"}]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment