We've currently got a couple of instances of BEM-style block and element component classes that live in separate files:
FlexContainer and FlexItem
UnderlineNav and UnderlineNavLink
@broccolini and I chatted about this briefly yesterday and the idea of colocating them came up, which would change this:
import {FlexContainer, FlexItem} from 'primer-react'
export default () => (
<FlexContainer>
<FlexItem>Hello</FlexItem>
<FlexItem>World</FlexItem>
</FlexContainer>
)
to:
import {Flex} from 'primer-react'
export default () => (
<Flex>
<Flex.Item>Hello</Flex.Item>
<Flex.Item>World</Flex.Item>
</Flex>
)
and this:
import {UnderlineNav, UnderlineNavLink} from 'primer-react'
export default () => (
<UnderlineNav>
<UnderlineNavLink href="/">Home</UnderlineNavLink>
<UnderlineNavLink href="/about/">About</UnderlineNavLink>
</UnderlineNav>
)
to:
import {UnderlineNav} from 'primer-react'
export default () => (
<UnderlineNav>
<UnderlineNav.Link href="/">Home</UnderlineNav.Link>
<UnderlineNav.Link href="/about/">About</UnderlineNav.Link>
</UnderlineNav>
)
Let's decide whether we want to do this and maybe include our reasoning in our design principles? /cc #50
We've currently got a couple of instances of BEM-style block and element component classes that live in separate files:
FlexContainerandFlexItemUnderlineNavandUnderlineNavLink@broccolini and I chatted about this briefly yesterday and the idea of colocating them came up, which would change this:
to:
and this:
to:
Let's decide whether we want to do this and maybe include our reasoning in our design principles? /cc #50