diff --git a/src/index.jsx b/src/index.jsx index fd4d46a..1ae5a12 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -1,24 +1,11 @@ import "resources/nav/index.js" -// https://stackoverflow.com/questions/1409225/changing-a-css-rule-set-from-javascript -function getCSSRule(ruleName) { - ruleName = ruleName.toLowerCase(); - var result = null; - var find = Array.prototype.find; - - find.call(document.styleSheets, styleSheet => { - result = find.call(styleSheet.cssRules, cssRule => { - return cssRule instanceof CSSStyleRule - && cssRule.selectorText.toLowerCase() == ruleName; - }); - return result != null; - }); - return result; -} - class SOGNavPlugin { initialize(registry, store) { - getCSSRule(".SOGNav__MenuItem").style.margin = "8px"; + let elements = document.getElementsByClassName("SOGNav__MenuItem"); + for (let i = 0; i < elements.length; i++) { + elements[i].style.margin = "8px"; + } } }