Skip to content

Commit 7860079

Browse files
committed
docs: use is=, not as=, _except_ in Frame 🙃
1 parent 3dab006 commit 7860079

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

docs/src/CodeExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default function CodeExample(props) {
4646
<ClipboardCopy value={source} />
4747
</Absolute>
4848
<Text
49-
as={LiveError}
49+
is={LiveError}
5050
fontFamily="mono"
5151
style={{
5252
overflow: 'auto',

docs/src/Header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const Header = props => (
2828
<NavLink href="/css/getting-started" />
2929
<NavLink href="/css/principles" />
3030
<NavLink href="/css/tools" />
31-
<NavLink as={Link} href="https://github.com/primer/primer/releases">
31+
<NavLink is={Link} href="https://github.com/primer/primer/releases">
3232
Releases
3333
</NavLink>
3434
</HeaderText>

docs/src/Outline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {Box} from '@primer/components'
44
export default function Outline({outline, ...rest}) {
55
if (outline && outline.length) {
66
return (
7-
<Box as="details" mb={4}>
7+
<Box is="details" mb={4}>
88
<summary>Table of contents</summary>
99
<OutlineList items={outline} {...rest} />
1010
</Box>

docs/src/PackageHeader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export default function PackageHeader(props) {
3838

3939
return (
4040
<Flex justifyContent="space-between" mb={4} {...rest}>
41-
<Text as="div" fontSize={1}>
42-
{status ? <StatusLabel status={status} as="a" href="/css/status-key" mr={2} /> : null}
41+
<Text is="div" fontSize={1}>
42+
{status ? <StatusLabel status={status} is="a" href="/css/status-key" mr={2} /> : null}
4343
{info}
4444
</Text>
4545
<Box>

docs/src/SideNav.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {rootPage} from './utils'
77

88
export default function SideNav(props) {
99
return (
10-
<Relative as="nav">
10+
<Relative is="nav">
1111
<Box id="sidenav" {...props}>
1212
<Flex flexDirection="column" alignItems="start">
1313
<Router>

docs/src/color-system.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ export function ColorVariables(props) {
4242
<Flex flexWrap="wrap" {...props}>
4343
<FadeVariables id="black" hue="black" bg="black" color="white">
4444
<BorderBox border={0} borderRadius={0} borderTop={1} borderColor="gray.5" mt={1}>
45-
<Text as="div" fontSize={2} pt={3} mb={0}>
45+
<Text is="div" fontSize={2} pt={3} mb={0}>
4646
Black fades apply alpha transparency to the <Var>$black</Var> variable. The black color value has a slight
4747
blue hue to match our grays.
4848
</Text>
4949
</BorderBox>
5050
</FadeVariables>
5151
<FadeVariables id="white" hue="white" over={BLACK}>
5252
<BorderBox border={0} borderRadius={0} borderTop={1} mt={1}>
53-
<Text as="div" fontSize={2} pt={3} mb={0}>
53+
<Text is="div" fontSize={2} pt={3} mb={0}>
5454
White fades apply alpha transparency to the <Var>$white</Var> variable, below these are shown overlaid on
5555
a dark gray background.
5656
</Text>
@@ -64,14 +64,14 @@ export function ColorVariables(props) {
6464
export function ColorVariable({hue, ...rest}) {
6565
const values = colors[hue]
6666
return (
67-
<Flex.Item as={Box} pr={4} mb={6} className="col-6 markdown-no-margin" {...rest}>
68-
{/* <Heading as="div">{titleCase(hue)}</Heading> */}
67+
<Flex.Item is={Box} pr={4} mb={6} className="col-6 markdown-no-margin" {...rest}>
68+
{/* <Heading is="div">{titleCase(hue)}</Heading> */}
6969
<Box bg={`${hue}.5`} my={2} p={3} color="white">
70-
<Heading as="div" pb={3} fontSize={56} fontWeight="light">
70+
<Heading is="div" pb={3} fontSize={56} fontWeight="light">
7171
{titleCase(hue)}
7272
</Heading>
7373
<Flex justifyContent="space-between">
74-
<Flex.Item flex="1 1 auto" as={Var}>
74+
<Flex.Item flex="1 1 auto" is={Var}>
7575
${hue}-500
7676
</Flex.Item>
7777
<Text fontFamily="mono">{values[5]}</Text>
@@ -103,14 +103,14 @@ export function FadeVariables({hue, color, bg, over, children, ...rest}) {
103103
})
104104
const boxProps = {color, bg}
105105
return (
106-
<Flex.Item as={Box} pr={4} mb={6} width={1 / 2} className="markdown-no-margin" {...rest}>
107-
{/* <Heading as="div">{titleCase(hue)}</Heading> */}
106+
<Flex.Item is={Box} pr={4} mb={6} width={1 / 2} className="markdown-no-margin" {...rest}>
107+
{/* <Heading is="div">{titleCase(hue)}</Heading> */}
108108
<Box my={2} p={3} {...boxProps}>
109-
<Heading as="div" pb={3} fontSize={56} fontWeight="light">
109+
<Heading is="div" pb={3} fontSize={56} fontWeight="light">
110110
{titleCase(hue)}
111111
</Heading>
112112
<Flex justifyContent="space-between">
113-
<Flex.Item flex="1 1 auto" as={Var}>
113+
<Flex.Item flex="1 1 auto" is={Var}>
114114
${hue}
115115
</Flex.Item>
116116
<Text fontFamily="mono">
@@ -141,7 +141,7 @@ function Swatch(props) {
141141
const {name, value, textColor = overlayColor(value), ...rest} = props
142142
return (
143143
<Box bg={value} color={textColor} {...rest}>
144-
<Text as={Flex} fontSize={1} justifyContent="space-between">
144+
<Text is={Flex} fontSize={1} justifyContent="space-between">
145145
<Box p={3}>
146146
<Var>${name}</Var>
147147
</Box>
@@ -161,7 +161,7 @@ Swatch.propTypes = {
161161

162162
function Var(props) {
163163
// FIXME: fontStyle should be a prop, right?
164-
return <Text as="var" fontWeight="bold" fontFamily="mono" style={{fontStyle: 'normal'}} {...props} />
164+
return <Text is="var" fontWeight="bold" fontFamily="mono" style={{fontStyle: 'normal'}} {...props} />
165165
}
166166

167167
function overlayColor(bg) {

docs/src/landing/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import ColorImage from './ColorImage.svg'
1010

1111
export {default as HeaderImage} from './HeaderImage.svg'
1212

13-
const OverviewTitle = props => <Heading fontSize={3} fontWeight="normal" as="div" {...props} />
13+
const OverviewTitle = props => <Heading fontSize={3} fontWeight="normal" is="div" {...props} />
1414
const OverviewText = props => <Text fontSize={1} {...props} />
1515

1616
export function StylesOverview(props) {
@@ -34,7 +34,7 @@ export function StylesOverview(props) {
3434
return (
3535
<Flex {...props}>
3636
{styleTypes.map(({name, desc, image}) => (
37-
<Flex.Item as={Text} textAlign="center" mx={4} key={name}>
37+
<Flex.Item is={Text} textAlign="center" mx={4} key={name}>
3838
<Image src={image} height={90} mb={2} />
3939
<OverviewTitle>{name}</OverviewTitle>
4040
<OverviewText>{desc}</OverviewText>
@@ -103,9 +103,9 @@ function Image(props) {
103103
const {src, ...rest} = props
104104
switch (typeof src) {
105105
case 'string':
106-
return <Box as="img" width="100%" alt="" {...props} />
106+
return <Box is="img" width="100%" alt="" {...props} />
107107
case 'function':
108-
return <Box as={src} {...rest} />
108+
return <Box is={src} {...rest} />
109109
default:
110110
throw new Error(`Unrecognized Image.src type: "${typeof src}"`)
111111
}
@@ -127,7 +127,7 @@ export function PrimerPackageBox({data = {}, count, ...rest}) {
127127
</Link>
128128
</Flex>
129129
{count ? (
130-
<Text as="div" textAlign="center">
130+
<Text is="div" textAlign="center">
131131
This package includes all {count} Primer modules.
132132
</Text>
133133
) : null}
@@ -139,9 +139,9 @@ export function PrimerPackageBox({data = {}, count, ...rest}) {
139139
export function MetaPackageBox({children, data = {}, title, ...rest}) {
140140
const deps = data.dependencies || []
141141
return (
142-
<Flex.Item as={BorderBox} bg="white" maxWidth={220} {...rest}>
142+
<Flex.Item is={BorderBox} bg="white" maxWidth={220} {...rest}>
143143
<BorderBox bg="gray.1" border={0} borderBottom={1} borderRadius={0} px={3} py={2}>
144-
<Heading as="div" fontSize={2}>
144+
<Heading is="div" fontSize={2}>
145145
<Link href={packageSourceURL(data.name)} color="inherit">
146146
{title}
147147
</Link>{' '}

0 commit comments

Comments
 (0)