This plugin is specific to Primer CSS. We'll accept pull requests to make it more generic, or feel free to fork and use it for your own needs.
Utilities are single purpose styles that should be treated as immutable CSS. They should not be altered by custom CSS as this can cause unwanted side effects.
.m-0, #bar .float-left, #hoo { border: 1px solid pink; }
/** ↑ ↑
* Each of these selectors */
The following patterns are considered warnings:
#bar .float-left { border: 1px solid pink; }
#bar {
.float-left { border: 1px solid pink; }
}
The following patterns are not considered warnings:
#bar { color: pink; }
This repository is distributed with npm, and can be installed with:
$ npm install --save-dev stylelint-selector-no-utility
In your stylelint config add this.
{
"plugins": [
"stylelint-selector-no-utility"
],
"rules": {
"primer/selector-no-utility": true
}
}
MIT © GitHub
stylelint-selector-no-utility's People
stylelint-selector-no-utility's Issues
Send PR to stylelint docs?
This plugin looks great!
Would you consider sending a PR to stylelint
adding it to the list of plugins? Or, let me know if you're OK with it being added, and I can do it for you. The list is looking a little sparse at the moment you see, and we're keen to adding some good quality plugins to it to get things going :)
Upgrade stylelint
In order to address primer/stylelint-config#22, we'd need to upgrade to stylelint >=9.8.0. Since the micromatch team confirmed that that vulnerability isn't really an issue & this would take upgrading two breaking versions up, I'd consider this low urgency, but would be nice to do eventually so people don't see that alert on vuln audits.
Forbid all overrides of Primer classnames
We'd like to change this stylelint rule to include all classnames (or more specifically, selectors?) in Primer CSS. So:
- Update the rule look for classnames in
stats/primer.json
, rather thanstats/utilities.json
. - Rename this package and repo to something more accurate, e.g.
stylelint-no-primer-override
/cc @primer/ds-core
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.