Skip to content

Commit

Permalink
Update ven.selectorstoarray.js
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJaredWilcurt committed Aug 10, 2016
1 parent d54cb5c commit e183dfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/ven.selectorstoarray.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// github.com/TheJaredWilcurt/css-selectors-to-js-array | Public Domain | v1.0.1
// github.com/TheJaredWilcurt/css-selectors-to-js-array | Public Domain | v1.0.2

function selectorsToArray (css) {
// Regex to detect @media (stuff) then {
Expand All @@ -10,17 +10,17 @@ function selectorsToArray (css) {
// Check if the CSS contains any media queries
if (mediaQ.test(css)) {
// Remove all media queries, they are not selectors
css = css.split(mediaQ).join('');
css = css.replace(mediaQ, '');
}
// Check if the CSS contains single line comments
if (comment.test(css)) {
// Remove all comments, they are not selectors
css = css.split(comment).join('');
css = css.replace(comment, '');
}
// Check if the CSS contains multi-line comments
if (comments.test(css)) {
// Remove all comments, they are not selectors
css = css.split(comments).join('');
css = css.replace(comments, '');
}

// Split the whole thing based on opening curly braces
Expand Down

0 comments on commit e183dfd

Please sign in to comment.