mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 21:33:32 -06:00
Initial commit
This commit is contained in:
145
node_modules/stylelint/lib/rules/property-case/README.md
generated
vendored
Normal file
145
node_modules/stylelint/lib/rules/property-case/README.md
generated
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
# property-case
|
||||
|
||||
Specify lowercase or uppercase for properties.
|
||||
|
||||
```css
|
||||
a { width: 1px; }
|
||||
/** ↑
|
||||
* These properties */
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
`string`: `"lower"|"upper"`
|
||||
|
||||
### `"lower"`
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
a {
|
||||
Width: 1px
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
WIDTH: 1px
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
widtH: 1px
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
border-Radius: 5px;
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
-WEBKIT-animation-duration: 3s;
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (orientation: landscape) {
|
||||
WiDtH: 500px;
|
||||
}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
a {
|
||||
width: 1px
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
border-radius: 5px;
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
-webkit-animation-duration: 3s;
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (orientation: landscape) {
|
||||
width: 500px;
|
||||
}
|
||||
```
|
||||
|
||||
### `"upper"`
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
a {
|
||||
Width: 1px
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
width: 1px
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
widtH: 1px
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
border-Radius: 5px;
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
-WEBKIT-animation-duration: 3s;
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (orientation: landscape) {
|
||||
WiDtH: 500px;
|
||||
}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
a {
|
||||
WIDTH: 1px
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
BORDER-RADIUS: 5px;
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
-WEBKIT-ANIMATION-DURATION: 3s;
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (orientation: landscape) {
|
||||
WIDTH: 500px;
|
||||
}
|
||||
```
|
55
node_modules/stylelint/lib/rules/property-case/index.js
generated
vendored
Normal file
55
node_modules/stylelint/lib/rules/property-case/index.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict"
|
||||
|
||||
const isCustomProperty = require("../../utils/isCustomProperty")
|
||||
const isStandardSyntaxProperty = require("../../utils/isStandardSyntaxProperty")
|
||||
const report = require("../../utils/report")
|
||||
const ruleMessages = require("../../utils/ruleMessages")
|
||||
const validateOptions = require("../../utils/validateOptions")
|
||||
|
||||
const ruleName = "property-case"
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`,
|
||||
})
|
||||
|
||||
const rule = function (expectation) {
|
||||
return (root, result) => {
|
||||
const validOptions = validateOptions(result, ruleName, {
|
||||
actual: expectation,
|
||||
possible: [
|
||||
"lower",
|
||||
"upper",
|
||||
],
|
||||
})
|
||||
if (!validOptions) {
|
||||
return
|
||||
}
|
||||
|
||||
root.walkDecls(decl => {
|
||||
const prop = decl.prop
|
||||
|
||||
if (!isStandardSyntaxProperty(prop)) {
|
||||
return
|
||||
}
|
||||
if (isCustomProperty(prop)) {
|
||||
return
|
||||
}
|
||||
|
||||
const expectedProp = expectation === "lower" ? prop.toLowerCase() : prop.toUpperCase()
|
||||
if (prop === expectedProp) {
|
||||
return
|
||||
}
|
||||
|
||||
report({
|
||||
message: messages.expected(prop, expectedProp),
|
||||
node: decl,
|
||||
ruleName,
|
||||
result,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
rule.ruleName = ruleName
|
||||
rule.messages = messages
|
||||
module.exports = rule
|
Reference in New Issue
Block a user