-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support justify-content, align-items, align-self, align-content…
… properties (#628) * chore: add test files * feat: support justify-content property * feat: support align-items property * feat: support align-self property * feat: support align-content property
- Loading branch information
Showing
594 changed files
with
1,714 additions
and
26 deletions.
There are no files selected for viewing
File renamed without changes.
64 changes: 64 additions & 0 deletions
64
src/__tests__/properties/align-content/flex_context/baseline/test.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* eslint-disable sort/object-properties */ | ||
import { stripIndent } from 'common-tags'; | ||
import { getTestRule } from 'jest-preset-stylelint'; | ||
|
||
import { messages, plugin, ruleName } from '~/rule'; | ||
|
||
const testRule = getTestRule({ | ||
plugins: [plugin], | ||
}); | ||
|
||
testRule({ | ||
ruleName, | ||
config: [ | ||
true, | ||
{ | ||
allow: { | ||
features: [ | ||
'properties.align-content', | ||
'properties.align-content.flex_context.first_baseline', | ||
'properties.align-content.flex_context.last_baseline', | ||
], | ||
}, | ||
browserslist: 'chrome 20', | ||
}, | ||
], | ||
reject: [ | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: baseline; | ||
} | ||
`, | ||
line: 2, | ||
column: 18, | ||
endLine: 2, | ||
endColumn: 26, | ||
message: messages.rejected('"baseline" value specified as align-content', 'Chrome 20', ''), | ||
}, | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: first baseline; | ||
} | ||
`, | ||
line: 2, | ||
column: 24, | ||
endLine: 2, | ||
endColumn: 32, | ||
message: messages.rejected('"baseline" value specified as align-content', 'Chrome 20', ''), | ||
}, | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: last baseline; | ||
} | ||
`, | ||
line: 2, | ||
column: 23, | ||
endLine: 2, | ||
endColumn: 31, | ||
message: messages.rejected('"baseline" value specified as align-content', 'Chrome 20', ''), | ||
}, | ||
], | ||
}); |
33 changes: 33 additions & 0 deletions
33
src/__tests__/properties/align-content/flex_context/first_baseline/test.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* eslint-disable sort/object-properties */ | ||
import { stripIndent } from 'common-tags'; | ||
import { getTestRule } from 'jest-preset-stylelint'; | ||
|
||
import { messages, plugin, ruleName } from '~/rule'; | ||
|
||
const testRule = getTestRule({ | ||
plugins: [plugin], | ||
}); | ||
|
||
testRule({ | ||
ruleName, | ||
config: [ | ||
true, | ||
{ | ||
browserslist: 'chrome 58', | ||
}, | ||
], | ||
reject: [ | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: first baseline; | ||
} | ||
`, | ||
line: 2, | ||
column: 18, | ||
endLine: 2, | ||
endColumn: 32, | ||
message: messages.rejected('"first baseline" value specified as align-content', 'Chrome 58', ''), | ||
}, | ||
], | ||
}); |
33 changes: 33 additions & 0 deletions
33
src/__tests__/properties/align-content/flex_context/last_baseline/test.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* eslint-disable sort/object-properties */ | ||
import { stripIndent } from 'common-tags'; | ||
import { getTestRule } from 'jest-preset-stylelint'; | ||
|
||
import { messages, plugin, ruleName } from '~/rule'; | ||
|
||
const testRule = getTestRule({ | ||
plugins: [plugin], | ||
}); | ||
|
||
testRule({ | ||
ruleName, | ||
config: [ | ||
true, | ||
{ | ||
browserslist: 'chrome 107', | ||
}, | ||
], | ||
reject: [ | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: last baseline; | ||
} | ||
`, | ||
line: 2, | ||
column: 18, | ||
endLine: 2, | ||
endColumn: 31, | ||
message: messages.rejected('"last baseline" value specified as align-content', 'Chrome 107', ''), | ||
}, | ||
], | ||
}); |
45 changes: 45 additions & 0 deletions
45
src/__tests__/properties/align-content/flex_context/safe_unsafe/test.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* eslint-disable sort/object-properties */ | ||
import { stripIndent } from 'common-tags'; | ||
import { getTestRule } from 'jest-preset-stylelint'; | ||
|
||
import { messages, plugin, ruleName } from '~/rule'; | ||
|
||
const testRule = getTestRule({ | ||
plugins: [plugin], | ||
}); | ||
|
||
testRule({ | ||
ruleName, | ||
config: [ | ||
true, | ||
{ | ||
browserslist: 'chrome 114', | ||
}, | ||
], | ||
reject: [ | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: safe center; | ||
} | ||
`, | ||
line: 2, | ||
column: 18, | ||
endLine: 2, | ||
endColumn: 22, | ||
message: messages.rejected('"safe" value specified as align-content', 'Chrome 114', ''), | ||
}, | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: unsafe center; | ||
} | ||
`, | ||
line: 2, | ||
column: 18, | ||
endLine: 2, | ||
endColumn: 24, | ||
message: messages.rejected('"unsafe" value specified as align-content', 'Chrome 114', ''), | ||
}, | ||
], | ||
}); |
33 changes: 33 additions & 0 deletions
33
src/__tests__/properties/align-content/flex_context/space-evenly/test.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* eslint-disable sort/object-properties */ | ||
import { stripIndent } from 'common-tags'; | ||
import { getTestRule } from 'jest-preset-stylelint'; | ||
|
||
import { messages, plugin, ruleName } from '~/rule'; | ||
|
||
const testRule = getTestRule({ | ||
plugins: [plugin], | ||
}); | ||
|
||
testRule({ | ||
ruleName, | ||
config: [ | ||
true, | ||
{ | ||
browserslist: 'chrome 59', | ||
}, | ||
], | ||
reject: [ | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: space-evenly; | ||
} | ||
`, | ||
line: 2, | ||
column: 18, | ||
endLine: 2, | ||
endColumn: 30, | ||
message: messages.rejected('"space-evenly" value specified as align-content', 'Chrome 59', ''), | ||
}, | ||
], | ||
}); |
96 changes: 96 additions & 0 deletions
96
src/__tests__/properties/align-content/flex_context/start_end/test.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* eslint-disable sort/object-properties */ | ||
import { stripIndent } from 'common-tags'; | ||
import { getTestRule } from 'jest-preset-stylelint'; | ||
|
||
import { messages, plugin, ruleName } from '~/rule'; | ||
|
||
const testRule = getTestRule({ | ||
plugins: [plugin], | ||
}); | ||
|
||
testRule({ | ||
ruleName, | ||
config: [ | ||
true, | ||
{ | ||
allow: { | ||
features: ['properties.align-content.flex_context.safe_unsafe'], | ||
}, | ||
browserslist: 'chrome 92', | ||
}, | ||
], | ||
reject: [ | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: start; | ||
} | ||
`, | ||
line: 2, | ||
column: 18, | ||
endLine: 2, | ||
endColumn: 23, | ||
message: messages.rejected('"start" value specified as align-content', 'Chrome 92', ''), | ||
}, | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: safe start; | ||
} | ||
`, | ||
line: 2, | ||
column: 23, | ||
endLine: 2, | ||
endColumn: 28, | ||
message: messages.rejected('"start" value specified as align-content', 'Chrome 92', ''), | ||
}, | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: unsafe start; | ||
} | ||
`, | ||
line: 2, | ||
column: 25, | ||
endLine: 2, | ||
endColumn: 30, | ||
message: messages.rejected('"start" value specified as align-content', 'Chrome 92', ''), | ||
}, | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: end; | ||
} | ||
`, | ||
line: 2, | ||
column: 18, | ||
endLine: 2, | ||
endColumn: 21, | ||
message: messages.rejected('"end" value specified as align-content', 'Chrome 92', ''), | ||
}, | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: safe end; | ||
} | ||
`, | ||
line: 2, | ||
column: 23, | ||
endLine: 2, | ||
endColumn: 26, | ||
message: messages.rejected('"end" value specified as align-content', 'Chrome 92', ''), | ||
}, | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: unsafe end; | ||
} | ||
`, | ||
line: 2, | ||
column: 25, | ||
endLine: 2, | ||
endColumn: 28, | ||
message: messages.rejected('"end" value specified as align-content', 'Chrome 92', ''), | ||
}, | ||
], | ||
}); |
33 changes: 33 additions & 0 deletions
33
src/__tests__/properties/align-content/flex_context/stretch/test.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* eslint-disable sort/object-properties */ | ||
import { stripIndent } from 'common-tags'; | ||
import { getTestRule } from 'jest-preset-stylelint'; | ||
|
||
import { messages, plugin, ruleName } from '~/rule'; | ||
|
||
const testRule = getTestRule({ | ||
plugins: [plugin], | ||
}); | ||
|
||
testRule({ | ||
ruleName, | ||
config: [ | ||
true, | ||
{ | ||
browserslist: 'chrome 56', | ||
}, | ||
], | ||
reject: [ | ||
{ | ||
code: stripIndent` | ||
#id { | ||
align-content: stretch; | ||
} | ||
`, | ||
line: 2, | ||
column: 18, | ||
endLine: 2, | ||
endColumn: 25, | ||
message: messages.rejected('"stretch" value specified as align-content', 'Chrome 56', ''), | ||
}, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.