|
Last change
on this file since 2058e5c was 2058e5c, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Working / before login
|
-
Property mode
set to
100644
|
|
File size:
830 bytes
|
| Line | |
|---|
| 1 | let Declaration = require('../declaration')
|
|---|
| 2 | let utils = require('./grid-utils')
|
|---|
| 3 |
|
|---|
| 4 | class PlaceSelf extends Declaration {
|
|---|
| 5 | /**
|
|---|
| 6 | * Translate place-self to separate -ms- prefixed properties
|
|---|
| 7 | */
|
|---|
| 8 | insert(decl, prefix, prefixes) {
|
|---|
| 9 | if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
|
|---|
| 10 |
|
|---|
| 11 | // prevent doubling of prefixes
|
|---|
| 12 | if (decl.parent.some(i => i.prop === '-ms-grid-row-align')) {
|
|---|
| 13 | return undefined
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | let [[first, second]] = utils.parse(decl)
|
|---|
| 17 |
|
|---|
| 18 | if (second) {
|
|---|
| 19 | utils.insertDecl(decl, 'grid-row-align', first)
|
|---|
| 20 | utils.insertDecl(decl, 'grid-column-align', second)
|
|---|
| 21 | } else {
|
|---|
| 22 | utils.insertDecl(decl, 'grid-row-align', first)
|
|---|
| 23 | utils.insertDecl(decl, 'grid-column-align', first)
|
|---|
| 24 | }
|
|---|
| 25 |
|
|---|
| 26 | return undefined
|
|---|
| 27 | }
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | PlaceSelf.names = ['place-self']
|
|---|
| 31 |
|
|---|
| 32 | module.exports = PlaceSelf
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.