You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
609 B
25 lines
609 B
import { regExpToken, SPACE } from '../tokenTypes'
|
|
|
|
const ALIGN_CONTENT = regExpToken(
|
|
/(flex-(?:start|end)|center|stretch|space-(?:between|around))/
|
|
)
|
|
const JUSTIFY_CONTENT = regExpToken(
|
|
/(flex-(?:start|end)|center|space-(?:between|around|evenly))/
|
|
)
|
|
|
|
export default tokenStream => {
|
|
const alignContent = tokenStream.expect(ALIGN_CONTENT)
|
|
|
|
let justifyContent
|
|
if (tokenStream.hasTokens()) {
|
|
tokenStream.expect(SPACE)
|
|
justifyContent = tokenStream.expect(JUSTIFY_CONTENT)
|
|
} else {
|
|
justifyContent = 'stretch'
|
|
}
|
|
|
|
tokenStream.expectEmpty()
|
|
|
|
return { alignContent, justifyContent }
|
|
}
|