mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 13:23:32 -06:00
Initial commit
This commit is contained in:
98
node_modules/stylelint/lib/rules/at-rule-name-space-after/README.md
generated
vendored
Normal file
98
node_modules/stylelint/lib/rules/at-rule-name-space-after/README.md
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
# at-rule-name-space-after
|
||||
|
||||
Require a single space after at-rule names.
|
||||
|
||||
```css
|
||||
@media (max-width: 600px) {}
|
||||
/** ↑
|
||||
* The space after at-rule names */
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
`string`: `"always"|"always-single-line"`
|
||||
|
||||
### `"always"`
|
||||
|
||||
There *must always* be a single space after at-rule names.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@charset"UTF-8";
|
||||
```
|
||||
|
||||
```css
|
||||
@media(min-width: 700px) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media (min-width: 700px) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media
|
||||
(min-width: 700px) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@charset "UTF-8";
|
||||
```
|
||||
|
||||
```css
|
||||
@import url("x.css");
|
||||
```
|
||||
|
||||
```css
|
||||
@media (min-width: 700px) {}
|
||||
```
|
||||
|
||||
### `"always-single-line"`
|
||||
|
||||
There *must always* be a single space after at-rule names in single-line declaration blocks.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@charset"UTF-8";
|
||||
```
|
||||
|
||||
```css
|
||||
@media(min-width: 700px) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media (min-width: 700px) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@charset "UTF-8";
|
||||
```
|
||||
|
||||
```css
|
||||
@import url("x.css");
|
||||
```
|
||||
|
||||
```css
|
||||
@media (min-width: 700px) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media
|
||||
(min-width: 700px) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media(min-width: 700px) and
|
||||
(orientation: portrait) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media
|
||||
(min-width: 700px) and
|
||||
(orientation: portrait) {}
|
||||
```
|
39
node_modules/stylelint/lib/rules/at-rule-name-space-after/index.js
generated
vendored
Normal file
39
node_modules/stylelint/lib/rules/at-rule-name-space-after/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict"
|
||||
|
||||
const atRuleNameSpaceChecker = require("../atRuleNameSpaceChecker")
|
||||
const ruleMessages = require("../../utils/ruleMessages")
|
||||
const validateOptions = require("../../utils/validateOptions")
|
||||
const whitespaceChecker = require("../../utils/whitespaceChecker")
|
||||
|
||||
const ruleName = "at-rule-name-space-after"
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
expectedAfter: name => `Expected single space after at-rule name \"${name}\"`,
|
||||
})
|
||||
|
||||
const rule = function (expectation) {
|
||||
const checker = whitespaceChecker("space", expectation, messages)
|
||||
return (root, result) => {
|
||||
const validOptions = validateOptions(result, ruleName, {
|
||||
actual: expectation,
|
||||
possible: [
|
||||
"always",
|
||||
"always-single-line",
|
||||
],
|
||||
})
|
||||
if (!validOptions) {
|
||||
return
|
||||
}
|
||||
|
||||
atRuleNameSpaceChecker({
|
||||
root,
|
||||
result,
|
||||
locationChecker: checker.after,
|
||||
checkedRuleName: ruleName,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
rule.ruleName = ruleName
|
||||
rule.messages = messages
|
||||
module.exports = rule
|
Reference in New Issue
Block a user