mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat: add a way to globally ignore CSS attributes
This commit is contained in:
committed by
Nathan Walker
parent
3a7d6c7352
commit
150f623d65
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user