Skip to content

Commit

Permalink
Merge pull request stylus#891 from tonistiigi/619-slash-in-media
Browse files Browse the repository at this point in the history
Fixes stylus#619 stylus#888 Support slash in media
  • Loading branch information
tj committed Nov 20, 2012
2 parents 8ef59a0 + c20cc71 commit c4014ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ Lexer.prototype = {

media: function() {
var captures;
if (captures = /^@media[ \t]*([^\/{\n]+)/.exec(this.str)) {
if (captures = /^@media[ \t]*(.+?)(?=\/\/|[\n{])/.exec(this.str)) {
this.skip(captures);
return new Token('media', captures[1].trim());
}
Expand Down
5 changes: 5 additions & 0 deletions test/cases/regression.619.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@media only screen and (-o-min-device-pixel-ratio: 3/2) {
body {
font-size: 66%;
}
}
3 changes: 3 additions & 0 deletions test/cases/regression.619.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@media only screen and (-o-min-device-pixel-ratio: 3/2)
body
font-size 66%

0 comments on commit c4014ee

Please sign in to comment.