Skip to content

Commit 84fd558

Browse files
edusperoniNathanWalker
authored andcommitted
feat: add a way to globally ignore CSS attributes
1 parent 632fea0 commit 84fd558

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/core/css/system-classes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export namespace CSSUtils {
66
export const CLASS_PREFIX = 'ns-';
77
export const MODAL_ROOT_VIEW_CSS_CLASS = `${CLASS_PREFIX}${MODAL}`;
88
export const ROOT_VIEW_CSS_CLASS = `${CLASS_PREFIX}${ROOT}`;
9+
export const IgnoredCssDynamicAttributeTracking = new Set<string>();
910

1011
export function getSystemCssClasses(): string[] {
1112
return cssClasses;

packages/core/ui/styling/css-selector.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { isNullOrUndefined } from '../../utils/types';
44

55
import * as ReworkCSS from '../../css';
66
import { Combinator as ICombinator, SimpleSelectorSequence as ISimpleSelectorSequence, Selector as ISelector, SimpleSelector as ISimpleSelector, parseSelector } from '../../css/parser';
7+
import { CSSUtils } from '../../css/system-classes';
78

89
/**
910
* An interface describing the shape of a type on which the selectors may apply.
@@ -675,6 +676,9 @@ export class SelectorsMatch<T extends Node> implements ChangeAccumulator {
675676
public selectors: SelectorCore[];
676677

677678
public addAttribute(node: T, attribute: string): void {
679+
if (CSSUtils.IgnoredCssDynamicAttributeTracking.has(attribute)) {
680+
return;
681+
}
678682
const deps: Changes = this.properties(node);
679683
if (!deps.attributes) {
680684
deps.attributes = new Set();

0 commit comments

Comments
 (0)