8000 Possible references to domain-specific selector names in applyNamespacing · Issue #27 · jotform/css.js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Possible references to domain-specific selector names in applyNamespacing #27

Open
jonknowles opened this issue Dec 16, 2019 · 1 comment

Comments

@jonknowles
Copy link
jonknowles commented Dec 16, 2019

In css.js, there appears to be logic for special behavior for selectors such as '.form-all', '#stage', and '.supernova'. Am I right in assuming that these are specific to the use case that this tool was first developed for and are not related to general CSS rules?

The section with these selector names is here:

css.js/css.js

Lines 568 to 582 in f970443

if(obj.selector.indexOf('@font-face') > -1 || obj.selector.indexOf('keyframes') > -1 || obj.selector.indexOf('@import') > -1 || obj.selector.indexOf('.form-all') > -1 || obj.selector.indexOf('#stage') > -1){
continue;
}
if (obj.type !== 'media') {
var selector = obj.selector.split(',');
var newSelector = [];
for (var j = 0; j < selector.length; j++) {
if (selector[j].indexOf('.supernova') === -1) { //do not apply namespacing to selectors including supernova
newSelector.push(namespaceClass + ' ' + selector[j]);
} else {
newSelector.push(selector[j]);
}
}
obj.selector = newSelector.join(',');

@kemaldaggen
Copy link
Contributor

@jonknowles Yes you are correct. Those are forgotten and should be removed since this is an open source and kind of general purpose css parser.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0