简体   繁体   中英

How to prevent “force-attribute-nesting” Sass-Lint warnings when applying CSS properties to specific input elements, along with selects and textarea?

I'm using Sass-Lint in my build system and am getting the warning Attribute-selector should be nested within its parent Type-selector when using the following selector:

input[type='text'],
input[type='number'],
input[type='email'],
input[type='password'],
select,
textarea {
    color: gray;
}

How can this be updated to prevent the warning messages, but also apply the CSS properties to all of these elements? (I obviously don't want to apply the attribute selectors to select and textarea , but not sure how else to do it without having two separate selectors with duplicate properies?)

try this one, hope will be helpfull.

// sass-lint:disable-block no-qualifying-elements force-attribute-nesting
input[type='text'],
input[type='number'],
input[type='email'],
input[type='password'],
select,
textarea {
    color: gray;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM