Skip to content

Instantly share code, notes, and snippets.

@dflemstr
Created January 4, 2012 07:17
Show Gist options
  • Select an option

  • Save dflemstr/1558937 to your computer and use it in GitHub Desktop.

Select an option

Save dflemstr/1558937 to your computer and use it in GitHub Desktop.
Example of a difficult-to-parse CSS file
@import url("test.css");@import url("test2.css");@import url("test3.css");@import url("te st4.css");@media print,screen{a{}}@font-face{bla:"foo";}@media all and (min-width:500px){}@page {}@page :right{margin-left:4cm;margin-right:3cm;}*{margin:1em;}a{}a,li,em{border-radius:1px/2px;}a[rel]{}a[rel="youtube"]{}a[lang~="en"]{}a[b^="c"]{}a[b$="c"]{}a[b|="en"]{}.codesample[data-summary="helloWorld(){}"]{}svg|circle{}svg|circle[svg|class="bla"]{}a:root{}a:nth-child(12){}a:nth-child(2n + 3){}::f{}*::e(2){}a.bla{}a#b{}a:not(.b){}a:not(c.d > e[f|='g']){a:b;}a b c{}a.b c[d="e"] f#g .h>i~j.k+l [m="n"]{}.cl{i:url("../../images/close-map.png");j:no-repeat;k:0px 0px;}*{bla:gradient(more-gradient(3px solid red #000),rgb(122,233,355),"something with a } in it;");}
<!--
@import "test.css";
-->
/* @iMpOrt url(test2.css); */
@iM\70
\4frt url(te\000073t\32.css);
/**** /* /* ** /
@import url("test3.css");
***/
@import url("t\65 st3.css");
@import url("t\65\ st4.css");
@media print, screen {
a{}
}
@font-face {
bla: "foo";
}
@media all and (min-width:500px) {}
@page{}
@page :right {
margin-left:4cm;
margin-right:3cm
}
* {margin : 1em;}
a {}
a, li, em { border-radius: 1px / 2px;
}
a[rel] {}
a[rel = youtube] {}
a[ lang ~= "en" ] {}
a[ b ^= "c" ] {;;;}
a[b
$=
"c"]
{
}
a[b|="en"]{}
.codesample[data-summary=helloWorld\(\)\{\}] {}
svg|circle {}
svg|circle[svg|class = "bla"] {}
a:root {}
a:nth-child(12) {}
a:nth-child( 2n + 3 ) {}
::f {}
*::e(2) {}
a.bla{}
a#b{}
a:not(.b){}
a:not(c.d > e[f|='g']) { a: b}
a b c {}
a.b c[d="e"] f#g .h > i ~ j.k + l [m='n']{}
.cl {i: url(../../images/close-map.png);j: no-repeat; ; ;
; k: 0px 0px;}
* {bla: gradient(more-gradient(3px solid red #243), rgb(122, 233, 355), "something with a } in it");}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment