Skip to content

Commit da8d124

Browse files
bmeurerDevtools-frontend LUCI CQ
authored and
Devtools-frontend LUCI CQ
committed
Merge inspectorSyntaxHighlight.css and inspectorCommon.css.
Eventually we will need to split up the `inspectorCommon.css` styles into separate style sheets and be more explicit about their usage, but that's a bigger undertaking, and not something to start today. Bug: 391381439 Change-Id: Ib075553b808257d1ef72d1abdb981221b8f19b93 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6189458 Auto-Submit: Benedikt Meurer <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]> Reviewed-by: Alex Rudenko <[email protected]>
1 parent bf0e2b4 commit da8d124

File tree

9 files changed

+108
-148
lines changed

9 files changed

+108
-148
lines changed

config/gni/devtools_grd_files.gni

-1
Original file line numberDiff line numberDiff line change
@@ -2483,7 +2483,6 @@ grd_files_debug_sources = [
24832483
"front_end/ui/legacy/inlineButton.css.legacy.js",
24842484
"front_end/ui/legacy/inspectorCommon.css.js",
24852485
"front_end/ui/legacy/inspectorCommon.css.legacy.js",
2486-
"front_end/ui/legacy/inspectorSyntaxHighlight.css.legacy.js",
24872486
"front_end/ui/legacy/inspectorViewTabbedPane.css.legacy.js",
24882487
"front_end/ui/legacy/listWidget.css.legacy.js",
24892488
"front_end/ui/legacy/popover.css.legacy.js",

front_end/ui/legacy/BUILD.gn

+1-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ generate_css("legacy_css_files") {
2828
"infobar.css",
2929
"inlineButton.css",
3030
"inspectorCommon.css",
31-
"inspectorSyntaxHighlight.css",
3231
"inspectorViewTabbedPane.css",
3332
"listWidget.css",
3433
"popover.css",
@@ -54,10 +53,7 @@ generate_css("legacy_css_files") {
5453
}
5554

5655
copy_to_gen("copy_stylesheets_for_server") {
57-
sources = [
58-
"inspectorCommon.css",
59-
"inspectorSyntaxHighlight.css",
60-
]
56+
sources = [ "inspectorCommon.css" ]
6157
}
6258

6359
devtools_module("ui") {

front_end/ui/legacy/UIUtils.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1873,8 +1873,6 @@ export function injectCoreStyles(elementOrShadowRoot: Element|ShadowRoot): void
18731873
elementOrShadowRoot :
18741874
(elementOrShadowRoot.shadowRoot ?? elementOrShadowRoot.ownerDocument);
18751875
shadowRootOrDocument.adoptedStyleSheets.push(Buttons.textButtonStyles);
1876-
1877-
ThemeSupport.ThemeSupport.instance().injectHighlightStyleSheets(elementOrShadowRoot);
18781876
}
18791877

18801878
/**

front_end/ui/legacy/inspectorCommon.css

+105
Original file line numberDiff line numberDiff line change
@@ -1237,3 +1237,108 @@ devtools-toolbar {
12371237
opacity: 0%;
12381238
}
12391239
}
1240+
1241+
/* Syntax highlighting */
1242+
.webkit-css-property {
1243+
color: var(--webkit-css-property-color, var(--sys-color-token-property-special)); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
1244+
}
1245+
1246+
.webkit-html-comment {
1247+
color: var(--sys-color-token-comment);
1248+
}
1249+
1250+
.webkit-html-tag {
1251+
color: var(--sys-color-token-tag);
1252+
}
1253+
1254+
.webkit-html-tag-name,
1255+
.webkit-html-close-tag-name {
1256+
/* Keep this in sync with view-source.css (.webkit-html-tag) */
1257+
color: var(--sys-color-token-tag);
1258+
}
1259+
1260+
.webkit-html-pseudo-element {
1261+
/* This one is non-standard. */
1262+
color: var(--sys-color-token-pseudo-element);
1263+
}
1264+
1265+
.webkit-html-js-node,
1266+
.webkit-html-css-node {
1267+
color: var(--text-primary);
1268+
white-space: pre-wrap;
1269+
}
1270+
1271+
.webkit-html-text-node {
1272+
color: var(--text-primary);
1273+
unicode-bidi: -webkit-isolate;
1274+
}
1275+
1276+
.webkit-html-entity-value {
1277+
/* This one is non-standard. */
1278+
background-color: rgb(0 0 0 / 15%); /* stylelint-disable-line plugin/use_theme_colors */
1279+
/* See: crbug.com/1152736 for color variable migration. */
1280+
unicode-bidi: -webkit-isolate;
1281+
}
1282+
1283+
.webkit-html-doctype {
1284+
/* Keep this in sync with view-source.css (.webkit-html-doctype) */
1285+
color: var(--text-secondary);
1286+
/* See: crbug.com/1152736 for color variable migration. */
1287+
}
1288+
1289+
.webkit-html-attribute-name {
1290+
/* Keep this in sync with view-source.css (.webkit-html-attribute-name) */
1291+
color: var(--sys-color-token-attribute);
1292+
unicode-bidi: -webkit-isolate;
1293+
}
1294+
1295+
.webkit-html-attribute-value {
1296+
/* Keep this in sync with view-source.css (.webkit-html-attribute-value) */
1297+
color: var(--sys-color-token-attribute-value);
1298+
unicode-bidi: -webkit-isolate;
1299+
word-break: break-all;
1300+
}
1301+
1302+
.devtools-link {
1303+
color: var(--text-link);
1304+
text-decoration: underline;
1305+
outline-offset: 2px;
1306+
1307+
.elements-disclosure & {
1308+
color: var(--text-link);
1309+
}
1310+
1311+
devtools-icon {
1312+
vertical-align: baseline;
1313+
color: var(--sys-color-primary);
1314+
}
1315+
1316+
:focus .selected & devtools-icon {
1317+
color: var(--sys-color-tonal-container);
1318+
}
1319+
1320+
&:focus-visible {
1321+
outline-width: unset;
1322+
}
1323+
1324+
&.invalid-link {
1325+
color: var(--text-disabled);
1326+
text-decoration: none;
1327+
}
1328+
1329+
&:not(.devtools-link-prevent-click, .invalid-link) {
1330+
cursor: pointer;
1331+
}
1332+
1333+
@media (forced-colors: active) {
1334+
&:not(.devtools-link-prevent-click) {
1335+
forced-color-adjust: none;
1336+
color: linktext;
1337+
}
1338+
1339+
&:focus-visible {
1340+
background: Highlight;
1341+
color: HighlightText;
1342+
}
1343+
}
1344+
}

front_end/ui/legacy/inspectorSyntaxHighlight.css

-131
This file was deleted.

front_end/ui/legacy/theme_support/ThemeSupport.ts

-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
import * as Common from '../../../core/common/common.js';
3737
import * as Host from '../../../core/host/host.js';
38-
import inspectorSyntaxHighlightStyles from '../inspectorSyntaxHighlight.css.legacy.js';
3938

4039
let themeSupportInstance: ThemeSupport;
4140

@@ -148,10 +147,6 @@ export class ThemeSupport extends EventTarget {
148147
return this.themeNameInternal;
149148
}
150149

151-
injectHighlightStyleSheets(element: Element|ShadowRoot): void {
152-
this.appendStyle(element, inspectorSyntaxHighlightStyles);
153-
}
154-
155150
appendStyle(node: Node, {cssContent}: {cssContent: string}): void {
156151
const styleElement = document.createElement('style');
157152
styleElement.textContent = cssContent;

inspector_overlay/tool_highlight.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ body {
202202
}
203203

204204
.material-tag-name {
205-
/* Keep this in sync with inspectorSyntaxHighlight.css (--override-dom-tag-name-color) */
205+
/* Keep this in sync with inspectorCommon.css (--override-dom-tag-name-color) */
206206
color: rgb(136 18 128);
207207
}
208208

209209
.material-class-name,
210210
.material-node-id {
211-
/* Keep this in sync with inspectorSyntaxHighlight.css (.webkit-html-attribute-value) */
211+
/* Keep this in sync with inspectorCommon.css (.webkit-html-attribute-value) */
212212
color: rgb(26 26 166);
213213
}
214214

scripts/component_server/server.js

-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ const styleSheetPaths = [
149149
'front_end/design_tokens.css',
150150
'front_end/ui/components/buttons/textButton.css',
151151
'front_end/ui/legacy/inspectorCommon.css',
152-
'front_end/ui/legacy/inspectorSyntaxHighlight.css',
153152
'front_end/ui/components/docs/component_docs_styles.css',
154153
];
155154

scripts/test/run_header_check_non_js_files.js

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const EXEMPTED_FILES = new Set([
5353
['front_end', 'panels', 'sources', 'sourcesView.css'],
5454
['front_end', 'panels', 'timeline', 'timelinePanel.css'],
5555
['front_end', 'ui', 'legacy', 'filter.css'],
56-
['front_end', 'ui', 'legacy', 'inspectorSyntaxHighlight.css'],
5756
['front_end', 'ui', 'legacy', 'splitWidget.css'],
5857
['front_end', 'ui', 'legacy', 'suggestBox.css'],
5958
['front_end', 'ui', 'legacy', 'tabbedPane.css'],

0 commit comments

Comments
 (0)