mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
lower-case-dashed components css support fixed
This commit is contained in:
@@ -73,10 +73,15 @@ class CssTypeSelector extends CssSelector {
|
||||
return TYPE_SPECIFICITY;
|
||||
}
|
||||
public matches(view: view.View): boolean {
|
||||
return this.expression.toLowerCase() === view.typeName.toLowerCase();
|
||||
return matchesType(this.expression, view);
|
||||
}
|
||||
}
|
||||
|
||||
function matchesType(expression: string, view: view.View): boolean {
|
||||
return expression.toLowerCase() === view.typeName.toLowerCase() ||
|
||||
expression.toLowerCase() === view.typeName.split(/(?=[A-Z])/).join("-").toLowerCase();
|
||||
}
|
||||
|
||||
class CssIdSelector extends CssSelector {
|
||||
get specificity(): number {
|
||||
return ID_SPECIFICITY;
|
||||
@@ -150,7 +155,7 @@ export class CssVisualStateSelector extends CssSelector {
|
||||
}
|
||||
|
||||
if (this._isByType) {
|
||||
matches = this._match === view.cssType.toLowerCase();
|
||||
matches = matchesType(this._match, view);
|
||||
}
|
||||
|
||||
return matches;
|
||||
|
||||
Reference in New Issue
Block a user