Commit Graph
13 Commits
Author SHA1 Message Date
Kriti Sapra 56daf78ddb Updated no-multiple-empty-lines to only have 1 as max
DISABLE_THIRD_PARTY_CHECK=updated linting formatting
Bug: 1106746
Change-Id: I371bca95b7cf1e8b7eaa4f9e7c3860af4eedee3e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3057042
Commit-Queue: Kriti Sapra <kritisapra@google.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-07-28 14:10:15 +00:00
Jack Franklin 8425afc1eb [DarkMode] filter.css
Also discovered that the stylelint rule needs to allow
`rgb(var(...))`, so fixed that as a drive-by. This will change in time
but was the easiest path to getting the first migration stage done.

Bug: chromium:1152736
Change-Id: I70816edee5217dc3f52804877b04dd479a6edb15
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2909588
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-05-25 14:28:17 +00:00
Jack Franklin 04bf47b6f9 Fix stylelint rule error in text editor
This is a weird test case but if you've got Stylelint in your editor and
you're working on changing files, I've found that after typing "var("
(and my editor adding the closing ")"), the theme_colors rule tries to
run against this and fails as it expects the var() to contain a variable.
So if we do detect var(), we just do nothing and wait for the user to
actually fill it in.

Bug: chromium:1152736
Change-Id: Id78fa4f7b05a1107e609bd7b0cde5c0f4bbbc8e7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2896898
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-05-17 09:59:12 +00:00
Jack Franklin 075c2fd6fe Fix errors when linting theme colors in border-X properties.
This CL fixes the fact that the stylelint rule wouldn't deal with:

```
border-bottom: var(--foo) solid var(--color-details-hairline)
```

It does this via a naive regex that splits the border value into its
three pieces, and then only lints the final declaration, which is the
color.

Bug: 1198504
Change-Id: I409adaf8b8777112ce4f3b24f0a6f63bd7435c25
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2823831
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-04-13 16:12:48 +00:00
Tim van der Lippe aa61faf631 Move ui to ui/legacy
R=jacktfranklin@chromium.org

Bug: 1187573
Change-Id: Ifc536ba79b0a324aa38e76aa294c73cd699c6536
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2810839
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-04-07 16:06:59 +00:00
Jack Franklin c66cad4c17 [Theme Colors] exempt var(--image-file-*) from rule
Fixed: chromium:1184642
Change-Id: I902aa023dc18f46c00045a4522bfe106678f77ba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2735038
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-03-04 12:37:12 +00:00
Jack Franklin 33f773352d Fix use_theme_colors rule incorrectly flagging background-image: var(...) usage
I have also checked the codebase and there are no current instances where this
bug has caused any changes or incorrect stylelint-disable lines.

Fixed: chromium:1184242
Change-Id: I1eaa2dfd54a7a6062139be7186730f6bb844b349
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2732370
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-03-03 16:16:49 +00:00
Jack Franklin 6dbe837682 Lint border-color and outline usages in CSS.
Updates the use_theme_colors rule to pick out border-color rules.

Fixed:chromium:1182679
Change-Id: I0f0f9b4a30f588e901b57131c796d73f2ac73656
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2722441
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-03-02 07:20:46 +00:00
Jack Franklin 343c141919 merge inspectorStyle.css and inspectorCommon.css
It seems there is no requirement for these files to be split; they don't
seem to have a logical split and they are both injected into the `body`
element when DevTools runs. If we kept both of these files around, we'd
have to inject them both into the component docs helpers, and deal with
both of them when it comes to figuring out where legacy CSS variables
are defined.

To make it a bit simpler I've merged `inspectorStyle` into
`inspectorCommon`. I went this way because:

* `inspectorCommon.css` is (I think!) a better name than `inspectorStyle.css`
* `inspectorCommon.css` was bigger.

I also drive-by disabled the stylelint `comment-empty-line-before`,
which was forbidding empty lines before any CSS comments; which made the
entire file feel very squashed!

Bug: none
Change-Id: Ifaa834c7bf56291561e2e5cc124c4efd85c3cc56
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2716285
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-02-26 15:50:55 +00:00
Changhao Han 5663e48217 Add override prefix to stylelint theme color logic
Bug: chromium:1171775
Change-Id: Ia63217e154009034a585e8ccbd8ac482da519fae
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2720368
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
2021-02-26 11:52:44 +00:00
Jack Franklin 49a9481a74 Lint color usage in background and border-* properties.
The list of CSS properties we check for colors wasn't thorough and
didn't include `border-left/right/top/bottom` or `background` on its
own. This CL fixes that and disables the rule for any current
violations.

Bug: 1152736
Change-Id: Ic732d653fdfab0462a04dc891bcece1f44e5d471
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2676157
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2021-02-05 15:39:39 +00:00
Jack Franklin 8064d3ba7a Lint against non-theme-color variables
This CL turns on the use_theme_colors stylelint rule which enforces that
any colors use variables defined in our codebase.

There are many, many violations, unsurprisingly (about 1500), so for now
I have disabled every single violation. The goal of the dark mode
migration will be in part to remove all violations of this rule.

Additionally, new code going forwards should adhere to the rule and not
add the comment to disable the warning.

Bug: 1152736
Change-Id: I51372724ea51485daef3d4f75b7d3f60a7c8016f
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2671323
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-02-03 11:02:09 +00:00
Jack Franklin 374d3ef17a [DarkMode]: Plugin to lint color variable usage
This introduces the `use_theme_colors` Stylelint plugin which checks
that all colors used in our codebase use the CSS variables defined in
either themeColors.css or inspectorStyle.css. Long term we will remove
inspectorStyle.css but for now it's not going anywhere.

It does this by looking at certain rules and seeing if there are any
colors defined in them. If there are, it errors unless those use
variables that are defined.

It also can be run in fix mode, where it disables the rule for that
given line. This is important as we have 100s of violations of this rule
at the moment, and it's going to take time to get us to a place where we
do not.

It also will allow violations in a
:host-context(.-theme-with-dark-background) block as those will normally
be using specific colors to override (although this is discouraged).

Bug: chromium:1152736
Change-Id: I79281ba931ad94f76216ee1f4c8fd0406cf0c304
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2667199
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-02-02 15:48:09 +00:00