2023-08-17 09:47:40 +00:00
|
|
|
let Declaration = require('../declaration')
|
2022-01-21 08:28:41 +00:00
|
|
|
|
2023-08-17 09:47:40 +00:00
|
|
|
class GridStart extends Declaration {
|
2022-01-21 08:28:41 +00:00
|
|
|
/**
|
|
|
|
* Do not add prefix for unsupported value in IE
|
|
|
|
*/
|
2023-08-17 09:47:40 +00:00
|
|
|
check(decl) {
|
|
|
|
let value = decl.value
|
|
|
|
return !value.includes('/') && !value.includes('span')
|
2022-01-21 08:28:41 +00:00
|
|
|
}
|
2023-08-17 09:47:40 +00:00
|
|
|
|
2022-01-21 08:28:41 +00:00
|
|
|
/**
|
|
|
|
* Return a final spec property
|
|
|
|
*/
|
2023-08-17 09:47:40 +00:00
|
|
|
normalize(prop) {
|
|
|
|
return prop.replace('-start', '')
|
2022-01-21 08:28:41 +00:00
|
|
|
}
|
2023-08-17 09:47:40 +00:00
|
|
|
|
2022-01-21 08:28:41 +00:00
|
|
|
/**
|
|
|
|
* Change property name for IE
|
|
|
|
*/
|
2023-08-17 09:47:40 +00:00
|
|
|
prefixed(prop, prefix) {
|
|
|
|
let result = super.prefixed(prop, prefix)
|
2022-01-21 08:28:41 +00:00
|
|
|
if (prefix === '-ms-') {
|
2023-08-17 09:47:40 +00:00
|
|
|
result = result.replace('-start', '')
|
2022-01-21 08:28:41 +00:00
|
|
|
}
|
2023-08-17 09:47:40 +00:00
|
|
|
return result
|
|
|
|
}
|
|
|
|
}
|
2022-01-21 08:28:41 +00:00
|
|
|
|
2023-08-17 09:47:40 +00:00
|
|
|
GridStart.names = ['grid-row-start', 'grid-column-start']
|
2022-01-21 08:28:41 +00:00
|
|
|
|
2023-08-17 09:47:40 +00:00
|
|
|
module.exports = GridStart
|