Skip to content

Commit

Permalink
Merge pull request #134 from ktslwy/pseudo
Browse files Browse the repository at this point in the history
Fix pseudo class matching
  • Loading branch information
renatoi committed Mar 28, 2015
2 parents 82285ab + 819c23e commit b52525a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/atomizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ for (var pseudo in PSEUDOS) {
PSEUDO_REGEX.push(pseudo);
PSEUDO_REGEX.push(PSEUDOS[pseudo]);
}
PSEUDO_REGEX = '(?:' + PSEUDO_REGEX.join('|') + ')';
PSEUDO_REGEX = '(?:' + PSEUDO_REGEX.join('|') + ')(?![a-z])';

// regular grammar to match valid atomic classes
var GRAMMAR = {
Expand Down
4 changes: 2 additions & 2 deletions tests/atomizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('Atomizer()', function () {
it ('returns css by reading an array of class names', function () {
var atomizer = new Atomizer();
var config = {
classNames: ['Trsdu-.3s', 'sibling:c+D-n', 'End-0', 'Ta-start', 'Ta-end', 'Bgc-#fff.4', 'Bgc-#fff', 'P-55px', 'H-100%', 'M-a', 'test:h>Op-1:h', 'test:h_Op-1:h', 'Op-1', 'Op-1!', 'D-n!', 'C-#333', 'Mt-neg10px', 'W-1/3']
classNames: ['Trsdu-.3s', 'sibling:c+D-n', 'End-0', 'Ta-start', 'Ta-end', 'Bgc-#fff.4', 'Bgc-#fff', 'P-55px', 'H-100%', 'M-a', 'test:h>Op-1:h', 'test:h_Op-1:h', 'Op-1', 'Op-1!', 'D-n!', 'C-#333', 'C-#333:li', 'Mt-neg10px', 'W-1/3']
};
var expected = [
'.Bgc-\\#fff\\.4 {',
Expand All @@ -154,7 +154,7 @@ describe('Atomizer()', function () {
'.Bgc-\\#fff {',
' background-color: #fff;',
'}',
'.C-\\#333 {',
'.C-\\#333, .C-\\#333\\:li:link {',
' color: #333;',
'}',
'.sibling:checked + .sibling\\:c\\+D-n {',
Expand Down

0 comments on commit b52525a

Please sign in to comment.