Skip to content

Commit b1253f7

Browse files
committed
docs(consistent-selector-style): Added clearer description of selector styles
1 parent e2157ea commit b1253f7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/rules/consistent-selector-style.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ description: 'enforce a consistent style for CSS selectors'
1313

1414
## :book: Rule Details
1515

16-
This rule allows you to set a preferred style for your CSS (& other style language) selectors. In CSS, there is a wide list of options for selecting elements, however, the three most basic types select by element type (i.e. tag name), ID or class. This rule allows you to set a preference for some of these three styles over others. Not all selectors can be used in all situations, however. While class selectors can be used in any situation, ID selectors can only be used to select a single element and type selectors are only applicable when the list of selected elements is the list of all elements of the particular type. To help with this, the rule accepts a list of selector style preferences and reports situations when the given selector can be rewritten using a more preferred style.
16+
This rule allows you to set a preferred style for your CSS (& other style language) selectors. In CSS, there is a wide list of options for selecting elements, however, the three most basic types are:
17+
18+
- Selecting by element type (i.e. tag name), such as `a {}`
19+
- Selecting by element ID, such as `#link {}`
20+
- Selecting by element class, such as `.link {}`
21+
This rule allows you to set a preference for some of these three styles over others. Not all selectors can be used in all situations, however. While class selectors can be used in any situation, ID selectors can only be used to select a single element and type selectors are only applicable when the list of selected elements is the list of all elements of the particular type. To help with this, the rule accepts a list of selector style preferences and reports situations when the given selector can be rewritten using a more preferred style.
1722

1823
<!--eslint-skip-->
1924

0 commit comments

Comments
 (0)