Skip to content

Commit

Permalink
feat: add a way to globally ignore CSS attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
edusperoni committed Sep 21, 2023
1 parent 6418993 commit a077d60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/css/system-classes.ts
Expand Up @@ -6,6 +6,7 @@ export namespace CSSUtils {
export const CLASS_PREFIX = 'ns-';
export const MODAL_ROOT_VIEW_CSS_CLASS = `${CLASS_PREFIX}${MODAL}`;
export const ROOT_VIEW_CSS_CLASS = `${CLASS_PREFIX}${ROOT}`;
export const IgnoredCssDynamicAttributeTracking = new Set<string>();

export function getSystemCssClasses(): string[] {
return cssClasses;
Expand Down
4 changes: 4 additions & 0 deletions packages/core/ui/styling/css-selector.ts
Expand Up @@ -4,6 +4,7 @@ import { isNullOrUndefined } from '../../utils/types';

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

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

public addAttribute(node: T, attribute: string): void {
if (CSSUtils.IgnoredCssDynamicAttributeTracking.has(attribute)) {
return;
}
const deps: Changes = this.properties(node);
if (!deps.attributes) {
deps.attributes = new Set();
Expand Down

0 comments on commit a077d60

Please sign in to comment.