mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-13 01:54:52 +08:00
Include custom properties in CSSRuleParser
Bug: 1268754 Change-Id: If21278e5e5eb52626d6d02054509664d8fdf1257 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3563071 Reviewed-by: Mathias Bynens <mathias@chromium.org> Commit-Queue: Changhao Han <changhaohan@chromium.org>
This commit is contained in:
committed by
Devtools-frontend LUCI CQ
parent
cbfa6b8665
commit
ced8121dfd
@@ -96,7 +96,7 @@ export function parseCSS(text: string, chunkCallback: ChunkCallback): void {
|
||||
}
|
||||
break;
|
||||
case CSSParserStates.Style:
|
||||
if (tokenType.has('meta') || tokenType.has('property')) {
|
||||
if (tokenType.has('meta') || tokenType.has('property') || tokenType.has('variable-2')) {
|
||||
property = {
|
||||
name: tokenValue,
|
||||
value: '',
|
||||
|
||||
@@ -17,6 +17,7 @@ describe('panels/utils', async () => {
|
||||
|
||||
.child {
|
||||
display: grid;
|
||||
--child-theme-color: 100, 200, 0;
|
||||
}
|
||||
`;
|
||||
const current = `
|
||||
@@ -27,6 +28,7 @@ describe('panels/utils', async () => {
|
||||
|
||||
.child {
|
||||
display: grid;
|
||||
--child-theme-color: 5, 10, 15;
|
||||
padding: 10px;
|
||||
}`;
|
||||
const diff = Diff.Diff.DiffWrapper.lineDiff(original.split('\n'), current.split('\n'));
|
||||
@@ -40,6 +42,8 @@ describe('panels/utils', async () => {
|
||||
}
|
||||
|
||||
.child {
|
||||
/* --child-theme-color: 100, 200, 0; */
|
||||
--child-theme-color: 5, 10, 15;
|
||||
padding: 10px;
|
||||
}`,
|
||||
'formatted CSS changes are not correct');
|
||||
|
||||
Reference in New Issue
Block a user