astro-ghostcms/.pnpm-store/v3/files/81/9a7d6d9daee8e05f81751925df8...

25 lines
609 B
Plaintext
Raw Permalink Normal View History

2024-02-14 14:10:47 +00:00
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 }
}