Skip to content

Commit

Permalink
Merge pull request #99 from makque/fix-93-at-rules
Browse files Browse the repository at this point in the history
Proposed fix for #93
  • Loading branch information
mtscout6 committed Apr 5, 2016
2 parents a6ed986 + 8e9f363 commit 4487157
Show file tree
Hide file tree
Showing 4 changed files with 8,396 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/count.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ function count(ast) {
case 'keyframes':
case 'import':
case 'supports':
case 'charset':
case 'namespace':
return 0;
case 'page':
return 1;
default:
return countRules(ast.rules);
}
Expand Down
97 changes: 97 additions & 0 deletions test/fixtures/input/at-rules.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
@charset "UTF-8"; /* Test @charset, Test @charset as first line */

/* Test @import */
@import 'global.css';

/* Test @namespace */
@namespace url(http://www.w3.org/1999/xhtml); /* Namespace for XHTML */

@namespace svg url(http://www.w3.org/2000/svg); /* Namespace for SVG embedded in XHTML */

/* Test @media */
@media only screen
and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2) {
.module {
width: 100%;
}
}

@media print {

}

/* Test @supports */
@supports (display: flex) {
.module {
display: flex;
}
}

@supports (display: flex) and (-webkit-appearance: checkbox) {
.module {
display: flex;
}
}

/* Test @document */
@document /* Rules for a specific page */
url(http://css-tricks.com/),
url-prefix(http://css-tricks.com/snippets/),
domain(css-tricks.com),
regexp("https:.*") {
body {
font-family: Comic Sans;
}
}

/* Test @page */
@page :first {
margin: 1in;
}

/* Test @font-face */
@font-face {
font-family: 'MyWebFont';
src: url('myfont.woff2') format('woff2'),
url('myfont.woff') format('woff');
}

/* Test @keyframes */
@keyframes pulse {
0% {
background-color: #001f3f;
}

100% {
background-color: #ff4136;
}
}

/* Test @viewport */
@viewport {
min-width: 640px;
max-width: 800px;
}

@viewport {
zoom: 0.75;
min-zoom: 0.5;
max-zoom: 0.9;
}

@viewport {
orientation: landscape;
}

/* Test @counter-style */
@counter-style circled-alpha {
system: fixed;
symbols: Ⓐ Ⓑ Ⓒ Ⓓ Ⓔ Ⓕ Ⓖ Ⓗ Ⓘ Ⓙ Ⓚ Ⓛ Ⓜ Ⓝ Ⓞ Ⓟ Ⓠ Ⓡ Ⓢ Ⓣ Ⓤ Ⓥ Ⓦ Ⓧ Ⓨ Ⓩ;
suffix: " ";
}

.items {
list-style: circled-alpha;
}
Loading

0 comments on commit 4487157

Please sign in to comment.