create-jant 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/template/node_modules/@jant/core/CHANGELOG.md +6 -0
- package/template/node_modules/@jant/core/package.json +1 -5
- package/template/node_modules/@jant/core/src/preset.css +3 -1
- package/template/node_modules/@tailwindcss/{postcss → vite}/README.md +11 -61
- package/template/node_modules/@tailwindcss/vite/dist/index.d.mts +13 -0
- package/template/node_modules/@tailwindcss/vite/dist/index.mjs +1 -0
- package/template/node_modules/@tailwindcss/vite/node_modules/.bin/vite +21 -0
- package/template/node_modules/@tailwindcss/vite/package.json +42 -0
- package/template/package.json +1 -3
- package/template/src/style.css +0 -3
- package/template/vite.config.ts +2 -8
- package/template/node_modules/.bin/autoprefixer +0 -21
- package/template/node_modules/@jant/core/src/tailwind.ts +0 -20
- package/template/node_modules/@tailwindcss/postcss/dist/index.d.mts +0 -25
- package/template/node_modules/@tailwindcss/postcss/dist/index.d.ts +0 -25
- package/template/node_modules/@tailwindcss/postcss/dist/index.js +0 -10
- package/template/node_modules/@tailwindcss/postcss/dist/index.mjs +0 -10
- package/template/node_modules/@tailwindcss/postcss/package.json +0 -46
- package/template/node_modules/autoprefixer/LICENSE +0 -20
- package/template/node_modules/autoprefixer/README.md +0 -57
- package/template/node_modules/autoprefixer/bin/autoprefixer +0 -22
- package/template/node_modules/autoprefixer/data/prefixes.js +0 -1139
- package/template/node_modules/autoprefixer/lib/at-rule.js +0 -35
- package/template/node_modules/autoprefixer/lib/autoprefixer.d.ts +0 -95
- package/template/node_modules/autoprefixer/lib/autoprefixer.js +0 -164
- package/template/node_modules/autoprefixer/lib/brackets.js +0 -51
- package/template/node_modules/autoprefixer/lib/browsers.js +0 -79
- package/template/node_modules/autoprefixer/lib/declaration.js +0 -187
- package/template/node_modules/autoprefixer/lib/hacks/align-content.js +0 -49
- package/template/node_modules/autoprefixer/lib/hacks/align-items.js +0 -46
- package/template/node_modules/autoprefixer/lib/hacks/align-self.js +0 -56
- package/template/node_modules/autoprefixer/lib/hacks/animation.js +0 -17
- package/template/node_modules/autoprefixer/lib/hacks/appearance.js +0 -23
- package/template/node_modules/autoprefixer/lib/hacks/autofill.js +0 -26
- package/template/node_modules/autoprefixer/lib/hacks/backdrop-filter.js +0 -20
- package/template/node_modules/autoprefixer/lib/hacks/background-clip.js +0 -24
- package/template/node_modules/autoprefixer/lib/hacks/background-size.js +0 -23
- package/template/node_modules/autoprefixer/lib/hacks/block-logical.js +0 -40
- package/template/node_modules/autoprefixer/lib/hacks/border-image.js +0 -15
- package/template/node_modules/autoprefixer/lib/hacks/border-radius.js +0 -40
- package/template/node_modules/autoprefixer/lib/hacks/break-props.js +0 -63
- package/template/node_modules/autoprefixer/lib/hacks/cross-fade.js +0 -35
- package/template/node_modules/autoprefixer/lib/hacks/display-flex.js +0 -65
- package/template/node_modules/autoprefixer/lib/hacks/display-grid.js +0 -21
- package/template/node_modules/autoprefixer/lib/hacks/file-selector-button.js +0 -26
- package/template/node_modules/autoprefixer/lib/hacks/filter-value.js +0 -14
- package/template/node_modules/autoprefixer/lib/hacks/filter.js +0 -19
- package/template/node_modules/autoprefixer/lib/hacks/flex-basis.js +0 -39
- package/template/node_modules/autoprefixer/lib/hacks/flex-direction.js +0 -72
- package/template/node_modules/autoprefixer/lib/hacks/flex-flow.js +0 -53
- package/template/node_modules/autoprefixer/lib/hacks/flex-grow.js +0 -30
- package/template/node_modules/autoprefixer/lib/hacks/flex-shrink.js +0 -39
- package/template/node_modules/autoprefixer/lib/hacks/flex-spec.js +0 -19
- package/template/node_modules/autoprefixer/lib/hacks/flex-wrap.js +0 -19
- package/template/node_modules/autoprefixer/lib/hacks/flex.js +0 -54
- package/template/node_modules/autoprefixer/lib/hacks/fullscreen.js +0 -20
- package/template/node_modules/autoprefixer/lib/hacks/gradient.js +0 -447
- package/template/node_modules/autoprefixer/lib/hacks/grid-area.js +0 -34
- package/template/node_modules/autoprefixer/lib/hacks/grid-column-align.js +0 -28
- package/template/node_modules/autoprefixer/lib/hacks/grid-end.js +0 -52
- package/template/node_modules/autoprefixer/lib/hacks/grid-row-align.js +0 -28
- package/template/node_modules/autoprefixer/lib/hacks/grid-row-column.js +0 -33
- package/template/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js +0 -125
- package/template/node_modules/autoprefixer/lib/hacks/grid-start.js +0 -33
- package/template/node_modules/autoprefixer/lib/hacks/grid-template-areas.js +0 -84
- package/template/node_modules/autoprefixer/lib/hacks/grid-template.js +0 -69
- package/template/node_modules/autoprefixer/lib/hacks/grid-utils.js +0 -1117
- package/template/node_modules/autoprefixer/lib/hacks/image-rendering.js +0 -48
- package/template/node_modules/autoprefixer/lib/hacks/image-set.js +0 -18
- package/template/node_modules/autoprefixer/lib/hacks/inline-logical.js +0 -34
- package/template/node_modules/autoprefixer/lib/hacks/intrinsic.js +0 -61
- package/template/node_modules/autoprefixer/lib/hacks/justify-content.js +0 -54
- package/template/node_modules/autoprefixer/lib/hacks/mask-border.js +0 -38
- package/template/node_modules/autoprefixer/lib/hacks/mask-composite.js +0 -88
- package/template/node_modules/autoprefixer/lib/hacks/order.js +0 -42
- package/template/node_modules/autoprefixer/lib/hacks/overscroll-behavior.js +0 -33
- package/template/node_modules/autoprefixer/lib/hacks/pixelated.js +0 -34
- package/template/node_modules/autoprefixer/lib/hacks/place-self.js +0 -32
- package/template/node_modules/autoprefixer/lib/hacks/placeholder-shown.js +0 -19
- package/template/node_modules/autoprefixer/lib/hacks/placeholder.js +0 -33
- package/template/node_modules/autoprefixer/lib/hacks/print-color-adjust.js +0 -25
- package/template/node_modules/autoprefixer/lib/hacks/text-decoration-skip-ink.js +0 -23
- package/template/node_modules/autoprefixer/lib/hacks/text-decoration.js +0 -25
- package/template/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js +0 -14
- package/template/node_modules/autoprefixer/lib/hacks/transform-decl.js +0 -79
- package/template/node_modules/autoprefixer/lib/hacks/user-select.js +0 -33
- package/template/node_modules/autoprefixer/lib/hacks/writing-mode.js +0 -42
- package/template/node_modules/autoprefixer/lib/info.js +0 -123
- package/template/node_modules/autoprefixer/lib/old-selector.js +0 -67
- package/template/node_modules/autoprefixer/lib/old-value.js +0 -22
- package/template/node_modules/autoprefixer/lib/prefixer.js +0 -144
- package/template/node_modules/autoprefixer/lib/prefixes.js +0 -428
- package/template/node_modules/autoprefixer/lib/processor.js +0 -709
- package/template/node_modules/autoprefixer/lib/resolution.js +0 -97
- package/template/node_modules/autoprefixer/lib/selector.js +0 -150
- package/template/node_modules/autoprefixer/lib/supports.js +0 -302
- package/template/node_modules/autoprefixer/lib/transition.js +0 -329
- package/template/node_modules/autoprefixer/lib/utils.js +0 -93
- package/template/node_modules/autoprefixer/lib/value.js +0 -125
- package/template/node_modules/autoprefixer/lib/vendor.js +0 -14
- package/template/node_modules/autoprefixer/node_modules/.bin/autoprefixer +0 -21
- package/template/node_modules/autoprefixer/node_modules/.bin/browserslist +0 -21
- package/template/node_modules/autoprefixer/package.json +0 -48
- package/template/node_modules/postcss/LICENSE +0 -20
- package/template/node_modules/postcss/README.md +0 -29
- package/template/node_modules/postcss/lib/at-rule.d.ts +0 -140
- package/template/node_modules/postcss/lib/at-rule.js +0 -25
- package/template/node_modules/postcss/lib/comment.d.ts +0 -68
- package/template/node_modules/postcss/lib/comment.js +0 -13
- package/template/node_modules/postcss/lib/container.d.ts +0 -483
- package/template/node_modules/postcss/lib/container.js +0 -447
- package/template/node_modules/postcss/lib/css-syntax-error.d.ts +0 -248
- package/template/node_modules/postcss/lib/css-syntax-error.js +0 -133
- package/template/node_modules/postcss/lib/declaration.d.ts +0 -151
- package/template/node_modules/postcss/lib/declaration.js +0 -24
- package/template/node_modules/postcss/lib/document.d.ts +0 -69
- package/template/node_modules/postcss/lib/document.js +0 -33
- package/template/node_modules/postcss/lib/fromJSON.d.ts +0 -9
- package/template/node_modules/postcss/lib/fromJSON.js +0 -54
- package/template/node_modules/postcss/lib/input.d.ts +0 -227
- package/template/node_modules/postcss/lib/input.js +0 -265
- package/template/node_modules/postcss/lib/lazy-result.d.ts +0 -190
- package/template/node_modules/postcss/lib/lazy-result.js +0 -550
- package/template/node_modules/postcss/lib/list.d.ts +0 -60
- package/template/node_modules/postcss/lib/list.js +0 -58
- package/template/node_modules/postcss/lib/map-generator.js +0 -368
- package/template/node_modules/postcss/lib/no-work-result.d.ts +0 -46
- package/template/node_modules/postcss/lib/no-work-result.js +0 -138
- package/template/node_modules/postcss/lib/node.d.ts +0 -556
- package/template/node_modules/postcss/lib/node.js +0 -449
- package/template/node_modules/postcss/lib/parse.d.ts +0 -9
- package/template/node_modules/postcss/lib/parse.js +0 -42
- package/template/node_modules/postcss/lib/parser.js +0 -611
- package/template/node_modules/postcss/lib/postcss.d.mts +0 -69
- package/template/node_modules/postcss/lib/postcss.d.ts +0 -458
- package/template/node_modules/postcss/lib/postcss.js +0 -101
- package/template/node_modules/postcss/lib/postcss.mjs +0 -30
- package/template/node_modules/postcss/lib/previous-map.d.ts +0 -81
- package/template/node_modules/postcss/lib/previous-map.js +0 -144
- package/template/node_modules/postcss/lib/processor.d.ts +0 -115
- package/template/node_modules/postcss/lib/processor.js +0 -67
- package/template/node_modules/postcss/lib/result.d.ts +0 -205
- package/template/node_modules/postcss/lib/result.js +0 -42
- package/template/node_modules/postcss/lib/root.d.ts +0 -87
- package/template/node_modules/postcss/lib/root.js +0 -61
- package/template/node_modules/postcss/lib/rule.d.ts +0 -126
- package/template/node_modules/postcss/lib/rule.js +0 -27
- package/template/node_modules/postcss/lib/stringifier.d.ts +0 -46
- package/template/node_modules/postcss/lib/stringifier.js +0 -353
- package/template/node_modules/postcss/lib/stringify.d.ts +0 -9
- package/template/node_modules/postcss/lib/stringify.js +0 -11
- package/template/node_modules/postcss/lib/symbols.js +0 -5
- package/template/node_modules/postcss/lib/terminal-highlight.js +0 -70
- package/template/node_modules/postcss/lib/tokenize.js +0 -266
- package/template/node_modules/postcss/lib/warn-once.js +0 -13
- package/template/node_modules/postcss/lib/warning.d.ts +0 -147
- package/template/node_modules/postcss/lib/warning.js +0 -37
- package/template/node_modules/postcss/node_modules/.bin/nanoid +0 -21
- package/template/node_modules/postcss/package.json +0 -88
- package/template/tailwind.config.ts +0 -13
- /package/template/node_modules/@tailwindcss/{postcss → vite}/LICENSE +0 -0
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
let Declaration = require('../declaration')
|
|
2
|
-
let utils = require('./grid-utils')
|
|
3
|
-
|
|
4
|
-
class GridArea extends Declaration {
|
|
5
|
-
/**
|
|
6
|
-
* Translate grid-area to separate -ms- prefixed properties
|
|
7
|
-
*/
|
|
8
|
-
insert(decl, prefix, prefixes, result) {
|
|
9
|
-
if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
|
|
10
|
-
|
|
11
|
-
let values = utils.parse(decl)
|
|
12
|
-
|
|
13
|
-
let [rowStart, rowSpan] = utils.translate(values, 0, 2)
|
|
14
|
-
let [columnStart, columnSpan] = utils.translate(values, 1, 3)
|
|
15
|
-
|
|
16
|
-
;[
|
|
17
|
-
['grid-row', rowStart],
|
|
18
|
-
['grid-row-span', rowSpan],
|
|
19
|
-
['grid-column', columnStart],
|
|
20
|
-
['grid-column-span', columnSpan]
|
|
21
|
-
].forEach(([prop, value]) => {
|
|
22
|
-
utils.insertDecl(decl, prop, value)
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
utils.warnTemplateSelectorNotFound(decl, result)
|
|
26
|
-
utils.warnIfGridRowColumnExists(decl, result)
|
|
27
|
-
|
|
28
|
-
return undefined
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
GridArea.names = ['grid-area']
|
|
33
|
-
|
|
34
|
-
module.exports = GridArea
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
let Declaration = require('../declaration')
|
|
2
|
-
|
|
3
|
-
class GridColumnAlign extends Declaration {
|
|
4
|
-
/**
|
|
5
|
-
* Do not prefix flexbox values
|
|
6
|
-
*/
|
|
7
|
-
check(decl) {
|
|
8
|
-
return !decl.value.includes('flex-') && decl.value !== 'baseline'
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Change IE property back
|
|
13
|
-
*/
|
|
14
|
-
normalize() {
|
|
15
|
-
return 'justify-self'
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Change property name for IE
|
|
20
|
-
*/
|
|
21
|
-
prefixed(prop, prefix) {
|
|
22
|
-
return prefix + 'grid-column-align'
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
GridColumnAlign.names = ['grid-column-align']
|
|
27
|
-
|
|
28
|
-
module.exports = GridColumnAlign
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
let Declaration = require('../declaration')
|
|
2
|
-
let { isPureNumber } = require('../utils')
|
|
3
|
-
|
|
4
|
-
class GridEnd extends Declaration {
|
|
5
|
-
/**
|
|
6
|
-
* Change repeating syntax for IE
|
|
7
|
-
*/
|
|
8
|
-
insert(decl, prefix, prefixes, result) {
|
|
9
|
-
if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
|
|
10
|
-
|
|
11
|
-
let clonedDecl = this.clone(decl)
|
|
12
|
-
|
|
13
|
-
let startProp = decl.prop.replace(/end$/, 'start')
|
|
14
|
-
let spanProp = prefix + decl.prop.replace(/end$/, 'span')
|
|
15
|
-
|
|
16
|
-
if (decl.parent.some(i => i.prop === spanProp)) {
|
|
17
|
-
return undefined
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
clonedDecl.prop = spanProp
|
|
21
|
-
|
|
22
|
-
if (decl.value.includes('span')) {
|
|
23
|
-
clonedDecl.value = decl.value.replace(/span\s/i, '')
|
|
24
|
-
} else {
|
|
25
|
-
let startDecl
|
|
26
|
-
decl.parent.walkDecls(startProp, d => {
|
|
27
|
-
startDecl = d
|
|
28
|
-
})
|
|
29
|
-
if (startDecl) {
|
|
30
|
-
if (isPureNumber(startDecl.value)) {
|
|
31
|
-
let value = Number(decl.value) - Number(startDecl.value) + ''
|
|
32
|
-
clonedDecl.value = value
|
|
33
|
-
} else {
|
|
34
|
-
return undefined
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
decl.warn(
|
|
38
|
-
result,
|
|
39
|
-
`Can not prefix ${decl.prop} (${startProp} is not found)`
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
decl.cloneBefore(clonedDecl)
|
|
45
|
-
|
|
46
|
-
return undefined
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
GridEnd.names = ['grid-row-end', 'grid-column-end']
|
|
51
|
-
|
|
52
|
-
module.exports = GridEnd
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
let Declaration = require('../declaration')
|
|
2
|
-
|
|
3
|
-
class GridRowAlign extends Declaration {
|
|
4
|
-
/**
|
|
5
|
-
* Do not prefix flexbox values
|
|
6
|
-
*/
|
|
7
|
-
check(decl) {
|
|
8
|
-
return !decl.value.includes('flex-') && decl.value !== 'baseline'
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Change IE property back
|
|
13
|
-
*/
|
|
14
|
-
normalize() {
|
|
15
|
-
return 'align-self'
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Change property name for IE
|
|
20
|
-
*/
|
|
21
|
-
prefixed(prop, prefix) {
|
|
22
|
-
return prefix + 'grid-row-align'
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
GridRowAlign.names = ['grid-row-align']
|
|
27
|
-
|
|
28
|
-
module.exports = GridRowAlign
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
let Declaration = require('../declaration')
|
|
2
|
-
let utils = require('./grid-utils')
|
|
3
|
-
|
|
4
|
-
class GridRowColumn extends Declaration {
|
|
5
|
-
/**
|
|
6
|
-
* Translate grid-row / grid-column to separate -ms- prefixed properties
|
|
7
|
-
*/
|
|
8
|
-
insert(decl, prefix, prefixes) {
|
|
9
|
-
if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
|
|
10
|
-
|
|
11
|
-
let values = utils.parse(decl)
|
|
12
|
-
let [start, span] = utils.translate(values, 0, 1)
|
|
13
|
-
|
|
14
|
-
let hasStartValueSpan = values[0] && values[0].includes('span')
|
|
15
|
-
|
|
16
|
-
if (hasStartValueSpan) {
|
|
17
|
-
span = values[0].join('').replace(/\D/g, '')
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
;[
|
|
21
|
-
[decl.prop, start],
|
|
22
|
-
[`${decl.prop}-span`, span]
|
|
23
|
-
].forEach(([prop, value]) => {
|
|
24
|
-
utils.insertDecl(decl, prop, value)
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
return undefined
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
GridRowColumn.names = ['grid-row', 'grid-column']
|
|
32
|
-
|
|
33
|
-
module.exports = GridRowColumn
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
let Declaration = require('../declaration')
|
|
2
|
-
let Processor = require('../processor')
|
|
3
|
-
let {
|
|
4
|
-
autoplaceGridItems,
|
|
5
|
-
getGridGap,
|
|
6
|
-
inheritGridGap,
|
|
7
|
-
prefixTrackProp,
|
|
8
|
-
prefixTrackValue
|
|
9
|
-
} = require('./grid-utils')
|
|
10
|
-
|
|
11
|
-
class GridRowsColumns extends Declaration {
|
|
12
|
-
insert(decl, prefix, prefixes, result) {
|
|
13
|
-
if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
|
|
14
|
-
|
|
15
|
-
let { parent, prop, value } = decl
|
|
16
|
-
let isRowProp = prop.includes('rows')
|
|
17
|
-
let isColumnProp = prop.includes('columns')
|
|
18
|
-
|
|
19
|
-
let hasGridTemplate = parent.some(
|
|
20
|
-
i => i.prop === 'grid-template' || i.prop === 'grid-template-areas'
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Not to prefix rows declaration if grid-template(-areas) is present
|
|
25
|
-
*/
|
|
26
|
-
if (hasGridTemplate && isRowProp) {
|
|
27
|
-
return false
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
let processor = new Processor({ options: {} })
|
|
31
|
-
let status = processor.gridStatus(parent, result)
|
|
32
|
-
let gap = getGridGap(decl)
|
|
33
|
-
gap = inheritGridGap(decl, gap) || gap
|
|
34
|
-
|
|
35
|
-
let gapValue = isRowProp ? gap.row : gap.column
|
|
36
|
-
|
|
37
|
-
if ((status === 'no-autoplace' || status === true) && !hasGridTemplate) {
|
|
38
|
-
gapValue = null
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
let prefixValue = prefixTrackValue({
|
|
42
|
-
gap: gapValue,
|
|
43
|
-
value
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Insert prefixes
|
|
48
|
-
*/
|
|
49
|
-
decl.cloneBefore({
|
|
50
|
-
prop: prefixTrackProp({ prefix, prop }),
|
|
51
|
-
value: prefixValue
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
let autoflow = parent.nodes.find(i => i.prop === 'grid-auto-flow')
|
|
55
|
-
let autoflowValue = 'row'
|
|
56
|
-
|
|
57
|
-
if (autoflow && !processor.disabled(autoflow, result)) {
|
|
58
|
-
autoflowValue = autoflow.value.trim()
|
|
59
|
-
}
|
|
60
|
-
if (status === 'autoplace') {
|
|
61
|
-
/**
|
|
62
|
-
* Show warning if grid-template-rows decl is not found
|
|
63
|
-
*/
|
|
64
|
-
let rowDecl = parent.nodes.find(i => i.prop === 'grid-template-rows')
|
|
65
|
-
|
|
66
|
-
if (!rowDecl && hasGridTemplate) {
|
|
67
|
-
return undefined
|
|
68
|
-
} else if (!rowDecl && !hasGridTemplate) {
|
|
69
|
-
decl.warn(
|
|
70
|
-
result,
|
|
71
|
-
'Autoplacement does not work without grid-template-rows property'
|
|
72
|
-
)
|
|
73
|
-
return undefined
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Show warning if grid-template-columns decl is not found
|
|
78
|
-
*/
|
|
79
|
-
let columnDecl = parent.nodes.find(i => {
|
|
80
|
-
return i.prop === 'grid-template-columns'
|
|
81
|
-
})
|
|
82
|
-
if (!columnDecl && !hasGridTemplate) {
|
|
83
|
-
decl.warn(
|
|
84
|
-
result,
|
|
85
|
-
'Autoplacement does not work without grid-template-columns property'
|
|
86
|
-
)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Autoplace grid items
|
|
91
|
-
*/
|
|
92
|
-
if (isColumnProp && !hasGridTemplate) {
|
|
93
|
-
autoplaceGridItems(decl, result, gap, autoflowValue)
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return undefined
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Change IE property back
|
|
102
|
-
*/
|
|
103
|
-
normalize(prop) {
|
|
104
|
-
return prop.replace(/^grid-(rows|columns)/, 'grid-template-$1')
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Change property name for IE
|
|
109
|
-
*/
|
|
110
|
-
prefixed(prop, prefix) {
|
|
111
|
-
if (prefix === '-ms-') {
|
|
112
|
-
return prefixTrackProp({ prefix, prop })
|
|
113
|
-
}
|
|
114
|
-
return super.prefixed(prop, prefix)
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
GridRowsColumns.names = [
|
|
119
|
-
'grid-template-rows',
|
|
120
|
-
'grid-template-columns',
|
|
121
|
-
'grid-rows',
|
|
122
|
-
'grid-columns'
|
|
123
|
-
]
|
|
124
|
-
|
|
125
|
-
module.exports = GridRowsColumns
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
let Declaration = require('../declaration')
|
|
2
|
-
|
|
3
|
-
class GridStart extends Declaration {
|
|
4
|
-
/**
|
|
5
|
-
* Do not add prefix for unsupported value in IE
|
|
6
|
-
*/
|
|
7
|
-
check(decl) {
|
|
8
|
-
let value = decl.value
|
|
9
|
-
return !value.includes('/') && !value.includes('span')
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Return a final spec property
|
|
14
|
-
*/
|
|
15
|
-
normalize(prop) {
|
|
16
|
-
return prop.replace('-start', '')
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Change property name for IE
|
|
21
|
-
*/
|
|
22
|
-
prefixed(prop, prefix) {
|
|
23
|
-
let result = super.prefixed(prop, prefix)
|
|
24
|
-
if (prefix === '-ms-') {
|
|
25
|
-
result = result.replace('-start', '')
|
|
26
|
-
}
|
|
27
|
-
return result
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
GridStart.names = ['grid-row-start', 'grid-column-start']
|
|
32
|
-
|
|
33
|
-
module.exports = GridStart
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
let Declaration = require('../declaration')
|
|
2
|
-
let {
|
|
3
|
-
getGridGap,
|
|
4
|
-
inheritGridGap,
|
|
5
|
-
parseGridAreas,
|
|
6
|
-
prefixTrackProp,
|
|
7
|
-
prefixTrackValue,
|
|
8
|
-
warnGridGap,
|
|
9
|
-
warnMissedAreas
|
|
10
|
-
} = require('./grid-utils')
|
|
11
|
-
|
|
12
|
-
function getGridRows(tpl) {
|
|
13
|
-
return tpl
|
|
14
|
-
.trim()
|
|
15
|
-
.slice(1, -1)
|
|
16
|
-
.split(/["']\s*["']?/g)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
class GridTemplateAreas extends Declaration {
|
|
20
|
-
/**
|
|
21
|
-
* Translate grid-template-areas to separate -ms- prefixed properties
|
|
22
|
-
*/
|
|
23
|
-
insert(decl, prefix, prefixes, result) {
|
|
24
|
-
if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
|
|
25
|
-
|
|
26
|
-
let hasColumns = false
|
|
27
|
-
let hasRows = false
|
|
28
|
-
let parent = decl.parent
|
|
29
|
-
let gap = getGridGap(decl)
|
|
30
|
-
gap = inheritGridGap(decl, gap) || gap
|
|
31
|
-
|
|
32
|
-
// remove already prefixed rows
|
|
33
|
-
// to prevent doubling prefixes
|
|
34
|
-
parent.walkDecls(/-ms-grid-rows/, i => i.remove())
|
|
35
|
-
|
|
36
|
-
// add empty tracks to rows
|
|
37
|
-
parent.walkDecls(/grid-template-(rows|columns)/, trackDecl => {
|
|
38
|
-
if (trackDecl.prop === 'grid-template-rows') {
|
|
39
|
-
hasRows = true
|
|
40
|
-
let { prop, value } = trackDecl
|
|
41
|
-
trackDecl.cloneBefore({
|
|
42
|
-
prop: prefixTrackProp({ prefix, prop }),
|
|
43
|
-
value: prefixTrackValue({ gap: gap.row, value })
|
|
44
|
-
})
|
|
45
|
-
} else {
|
|
46
|
-
hasColumns = true
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
let gridRows = getGridRows(decl.value)
|
|
51
|
-
|
|
52
|
-
if (hasColumns && !hasRows && gap.row && gridRows.length > 1) {
|
|
53
|
-
decl.cloneBefore({
|
|
54
|
-
prop: '-ms-grid-rows',
|
|
55
|
-
raws: {},
|
|
56
|
-
value: prefixTrackValue({
|
|
57
|
-
gap: gap.row,
|
|
58
|
-
value: `repeat(${gridRows.length}, auto)`
|
|
59
|
-
})
|
|
60
|
-
})
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// warnings
|
|
64
|
-
warnGridGap({
|
|
65
|
-
decl,
|
|
66
|
-
gap,
|
|
67
|
-
hasColumns,
|
|
68
|
-
result
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
let areas = parseGridAreas({
|
|
72
|
-
gap,
|
|
73
|
-
rows: gridRows
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
warnMissedAreas(areas, decl, result)
|
|
77
|
-
|
|
78
|
-
return decl
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
GridTemplateAreas.names = ['grid-template-areas']
|
|
83
|
-
|
|
84
|
-
module.exports = GridTemplateAreas
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
let Declaration = require('../declaration')
|
|
2
|
-
let {
|
|
3
|
-
getGridGap,
|
|
4
|
-
inheritGridGap,
|
|
5
|
-
parseTemplate,
|
|
6
|
-
warnGridGap,
|
|
7
|
-
warnMissedAreas
|
|
8
|
-
} = require('./grid-utils')
|
|
9
|
-
|
|
10
|
-
class GridTemplate extends Declaration {
|
|
11
|
-
/**
|
|
12
|
-
* Translate grid-template to separate -ms- prefixed properties
|
|
13
|
-
*/
|
|
14
|
-
insert(decl, prefix, prefixes, result) {
|
|
15
|
-
if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
|
|
16
|
-
|
|
17
|
-
if (decl.parent.some(i => i.prop === '-ms-grid-rows')) {
|
|
18
|
-
return undefined
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
let gap = getGridGap(decl)
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* we must insert inherited gap values in some cases:
|
|
25
|
-
* if we are inside media query && if we have no grid-gap value
|
|
26
|
-
*/
|
|
27
|
-
let inheritedGap = inheritGridGap(decl, gap)
|
|
28
|
-
|
|
29
|
-
let { areas, columns, rows } = parseTemplate({
|
|
30
|
-
decl,
|
|
31
|
-
gap: inheritedGap || gap
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
let hasAreas = Object.keys(areas).length > 0
|
|
35
|
-
let hasRows = Boolean(rows)
|
|
36
|
-
let hasColumns = Boolean(columns)
|
|
37
|
-
|
|
38
|
-
warnGridGap({
|
|
39
|
-
decl,
|
|
40
|
-
gap,
|
|
41
|
-
hasColumns,
|
|
42
|
-
result
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
warnMissedAreas(areas, decl, result)
|
|
46
|
-
|
|
47
|
-
if ((hasRows && hasColumns) || hasAreas) {
|
|
48
|
-
decl.cloneBefore({
|
|
49
|
-
prop: '-ms-grid-rows',
|
|
50
|
-
raws: {},
|
|
51
|
-
value: rows
|
|
52
|
-
})
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (hasColumns) {
|
|
56
|
-
decl.cloneBefore({
|
|
57
|
-
prop: '-ms-grid-columns',
|
|
58
|
-
raws: {},
|
|
59
|
-
value: columns
|
|
60
|
-
})
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return decl
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
GridTemplate.names = ['grid-template']
|
|
68
|
-
|
|
69
|
-
module.exports = GridTemplate
|