Comments on: Using the Specificity of :where() as a CSS Reset https://css-tricks.com/using-the-specificity-of-where-as-a-css-reset/ Tips, Tricks, and Techniques on using Cascading Style Sheets. Mon, 02 Aug 2021 17:26:53 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: Deniz Akşimşek https://css-tricks.com/using-the-specificity-of-where-as-a-css-reset/#comment-1777304 Mon, 02 Aug 2021 17:26:53 +0000 https://css-tricks.com/?p=343613#comment-1777304 Note that browsers might remove the list role from an UL when you style it this way, similar to what they do to table-based layouts. A trick is to apply the no-bullet styling to lists with explicit role=list, globally and exclusively, so that we won’t have any inaccessible lists.

ul[role="list"] {
  padding: 0;
  list-style-type: none;
}
]]>
By: Marcin https://css-tricks.com/using-the-specificity-of-where-as-a-css-reset/#comment-1776430 Thu, 15 Jul 2021 13:49:29 +0000 https://css-tricks.com/?p=343613#comment-1776430 If you’ll use BEM methodology and keep your CSS structure flat, you could just write a class to change list’s default styles and you’ll use it whenever you need.

]]>
By: Daniel abril https://css-tricks.com/using-the-specificity-of-where-as-a-css-reset/#comment-1776323 Wed, 14 Jul 2021 15:09:19 +0000 https://css-tricks.com/?p=343613#comment-1776323 If u use ul:where([class]), you are adding extra specificity

]]>
By: Vishal Bhardwaj https://css-tricks.com/using-the-specificity-of-where-as-a-css-reset/#comment-1776189 Tue, 13 Jul 2021 02:52:30 +0000 https://css-tricks.com/?p=343613#comment-1776189 In reply to Konstantin.

Ooh! Really

]]>
By: John https://css-tricks.com/using-the-specificity-of-where-as-a-css-reset/#comment-1776183 Mon, 12 Jul 2021 23:31:06 +0000 https://css-tricks.com/?p=343613#comment-1776183 Interesting readability. In the op, it sounds like “where the UL has a class, do xxx, yyy”, whereas the second sounds a bit clunky – “On a UL with a class, do XXX, yyy”. I have to think about the ‘ul:where([class])’ a bit more. Although targeting the ul in this way would make it easier to find in the code, as opposed to seeing ‘:where’ then looking further at the declaration.

]]>
By: Konstantin https://css-tricks.com/using-the-specificity-of-where-as-a-css-reset/#comment-1776156 Mon, 12 Jul 2021 15:34:57 +0000 https://css-tricks.com/?p=343613#comment-1776156 Nice trick. If I’m not mistaken you can improve readability, a bit, by changing this selector into something like this:

ul:where([class]) {
  padding: 0;
  margin: 0;
  list-style-type: none;
}
]]>