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:
117
node_modules/stylelint/lib/rules/media-query-list-comma-space-before/README.md
generated
vendored
Normal file
117
node_modules/stylelint/lib/rules/media-query-list-comma-space-before/README.md
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
# media-query-list-comma-space-before
|
||||
|
||||
Require a single space or disallow whitespace before the commas of media query lists.
|
||||
|
||||
```css
|
||||
@media screen and (color) ,projection and (color) {}
|
||||
/** ↑
|
||||
* These commas */
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
`string`: `"always"|"never"|"always-single-line"|"never-single-line"`
|
||||
|
||||
### `"always"`
|
||||
|
||||
There *must always* be a single space before the commas.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color),projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
,projection and (color) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color) ,projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color) ,
|
||||
projection and (color) {}
|
||||
```
|
||||
|
||||
### `"never"`
|
||||
|
||||
There *must never* be whitepace before the commas.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color) ,projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
, projection and (color) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color),projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color),
|
||||
projection and (color) {}
|
||||
```
|
||||
|
||||
### `"always-single-line"`
|
||||
|
||||
There *must always* be a single space before the commas in single-line media query lists.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color),projection and (color) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color) ,projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
, projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
,projection and (color) {}
|
||||
```
|
||||
|
||||
### `"never-single-line"`
|
||||
|
||||
There *must never* be whitepace before the commas in single-line media query lists.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color) , projection and (color) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color),projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
,projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
, projection and (color) {}
|
||||
```
|
44
node_modules/stylelint/lib/rules/media-query-list-comma-space-before/index.js
generated
vendored
Normal file
44
node_modules/stylelint/lib/rules/media-query-list-comma-space-before/index.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
"use strict"
|
||||
|
||||
const ruleMessages = require("../../utils/ruleMessages")
|
||||
const validateOptions = require("../../utils/validateOptions")
|
||||
const whitespaceChecker = require("../../utils/whitespaceChecker")
|
||||
const mediaQueryListCommaWhitespaceChecker = require("../mediaQueryListCommaWhitespaceChecker")
|
||||
|
||||
const ruleName = "media-query-list-comma-space-before"
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
expectedBefore: () => "Expected single space before \",\"",
|
||||
rejectedBefore: () => "Unexpected whitespace before \",\"",
|
||||
expectedBeforeSingleLine: () => "Expected single space before \",\" in a single-line list",
|
||||
rejectedBeforeSingleLine: () => "Unexpected whitespace before \",\" in a single-line list",
|
||||
})
|
||||
|
||||
const rule = function (expectation) {
|
||||
const checker = whitespaceChecker("space", expectation, messages)
|
||||
return (root, result) => {
|
||||
const validOptions = validateOptions(result, ruleName, {
|
||||
actual: expectation,
|
||||
possible: [
|
||||
"always",
|
||||
"never",
|
||||
"always-single-line",
|
||||
"never-single-line",
|
||||
],
|
||||
})
|
||||
if (!validOptions) {
|
||||
return
|
||||
}
|
||||
|
||||
mediaQueryListCommaWhitespaceChecker({
|
||||
root,
|
||||
result,
|
||||
locationChecker: checker.before,
|
||||
checkedRuleName: ruleName,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
rule.ruleName = ruleName
|
||||
rule.messages = messages
|
||||
module.exports = rule
|
Reference in New Issue
Block a user