Problem/Motivation

Every time the GitLab CI-job 🧹 CSS linting (stylelint) runs, there's a warning:

Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme

Steps to reproduce

Find a MR that triggers the 🧹 CSS linting (stylelint) job and observe the warning.

Here's one I've prepared/found earlier: https://git.drupalcode.org/issue/drupal-3042127/-/jobs/3294813#L269-271

Proposed resolution

Do what's recommended in the warning, commit and move on to greater things in life.

$ npx update-browserslist-db@latest
$ yarn build:css

Now the warning should be gone.

Remaining tasks

Backport this to the gazillion current branches, TBD by the core committers.

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3486741

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

spokje created an issue. See original summary.

spokje’s picture

Issue summary: View changes
spokje’s picture

Issue summary: View changes
Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Just picking 1 change

[dir="rtl"] #drupal-off-canvas-wrapper .dropbutton-wrapper.dropbutton-single .dropbutton-action:first-child

Shouldn't this be

:dir(rtl) #drupal-off-canvas-wrapper .dropbutton-wrapper.dropbutton-single .dropbutton-action:first-child
spokje’s picture

Status: Needs work » Needs review

TBH: I don't know, but much more important, these are all "automagically" made changes by yarn build:css after I did the update of canisuse.

So even if it is indeed better to make that change, and again, I really am not a FE-person, so I have no clue, I believe that would be something for a follow-up issue?
(And I'm not even really sure about that one either...)

smustgrave’s picture

Asked #frontend channel. My concern is the current position is only checking that child selector and not the top level dir attribute.

markconroy’s picture

:dir(rtl) should work perfectly fine for us.

It's a CSS function that has been supported for quite a while.

https://developer.mozilla.org/en-US/docs/Web/CSS/:dir

smustgrave’s picture

My only question is the position of :dir() does that function only apply to that child selector or will it check that top level id dir=rtl?

markconroy’s picture

From MDN

The :dir() pseudo-class uses only the semantic value of the directionality, i.e., the one defined in the document itself.

Looks like it's document-level.

It seems [dir="rtl"] is only be valid if that is part of the HTML of the page, but :dif(rtl) can be inferred from other things like user-agents, for example.

https://drafts.csswg.org/selectors/#the-dir-pseudo

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

in that case I have no objections.

spokje’s picture

spokje’s picture

Priority: Normal » Critical

Mirroring status of parent issue, which became critical.

  • nod_ committed d8d9b246 on 11.1.x
    Issue #3486741 by spokje, smustgrave, markconroy: CSS linting (stylelint...

  • nod_ committed f39f9236 on 11.x
    Issue #3486741 by spokje, smustgrave, markconroy: CSS linting (stylelint...
nod_’s picture

Status: Reviewed & tested by the community » Fixed

Committed f39f923 and pushed to 11.x. Thanks!

spokje’s picture

Thanks @nod_, do we want to backport this down to other branches?

nod_’s picture

yes makes sense to backport to 10.4

nod_’s picture

Status: Fixed » Needs work
spokje’s picture

Version: 11.x-dev » 11.1.x-dev
Status: Needs work » Patch (to be ported)

Personally I think we might wanna backport this to 11.1.x, 10.5.x and 10.4.x
(Oh, the joy off multiple active main branches...)

I'll put MRs up for all three of them and let y'all decide.

spokje changed the visibility of the branch 11.x to hidden.

spokje’s picture

Version: 11.1.x-dev » 10.5.x-dev

So it already landed in 11.1.x, so making an MR for 10.5.x and am pretty hopeful this can be backported to 10.4.x easily.

nod_’s picture

Status: Patch (to be ported) » Needs review

nice thanks

spokje’s picture

Status: Needs review » Patch (to be ported)

Well, the bump in 10.5.x has surprisingly little, as in none at all, effect on the CSS files in there.

spokje’s picture

Status: Patch (to be ported) » Needs review

Oops

  • nod_ committed 66f97b08 on 10.4.x
    Issue #3486741 by spokje, smustgrave, markconroy: CSS linting (stylelint...

  • nod_ committed 00a3f6e4 on 10.5.x
    Issue #3486741 by spokje, smustgrave, markconroy: CSS linting (stylelint...

nod_’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.