Skip to content

Commit

Permalink
Revert "Check cssRules before css variables are read from stylesheet (#…
Browse files Browse the repository at this point in the history
…2454)"

This reverts commit fa79c35.

(cherry picked from commit 6f73b65)
  • Loading branch information
tdonohue authored and github-actions[bot] committed Oct 20, 2023
1 parent 1eeed36 commit 2834ac3
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/app/shared/sass-helper/css-variable.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ export class CSSVariableService {
return styleSheet.href.indexOf(window.location.origin) === 0;
};

/**
* Checks whether the specific stylesheet object has the property cssRules
* @param styleSheet The stylesheet
*/
hasCssRules = (styleSheet) => {
// Injected styles might have no css rules value
return styleSheet.hasOwnProperty('cssRules') && styleSheet.cssRules;
};

/*
Determine if the given rule is a CSSStyleRule
See: https://developer.mozilla.org/en-US/docs/Web/API/CSSRule#Type_constants
Expand Down Expand Up @@ -102,10 +93,8 @@ export class CSSVariableService {
if (isNotEmpty(document.styleSheets)) {
// styleSheets is array-like, so we convert it to an array.
// Filter out any stylesheets not on this domain
// Filter out any stylesheets that have no cssRules property
return [...document.styleSheets]
.filter(this.isSameDomain)
.filter(this.hasCssRules)
.reduce(
(finalArr, sheet) =>
finalArr.concat(
Expand Down

0 comments on commit 2834ac3

Please sign in to comment.