Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 76a527e

Browse files
committed
docs: carbon ads
1 parent b5941de commit 76a527e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+288
-68
lines changed

website/components/CarbonAd.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { Css } from '@chakra-ui/vue'
2+
import { css } from '@emotion/css'
3+
import { loadScript } from '~/utils'
4+
5+
const CarbonAd = {
6+
name: 'CarbonAd',
7+
inject: ['$chakraTheme', '$chakraColorMode'],
8+
computed: {
9+
colorMode: vm => vm.$chakraColorMode(),
10+
theme: vm => vm.$chakraTheme(),
11+
className () {
12+
const _css = styles => css(Css(styles)(this.theme))
13+
14+
return _css({
15+
display: 'block',
16+
position: 'relative',
17+
margin: '32px 0',
18+
maxWidth: '480px',
19+
minHeight: '132px',
20+
borderRadius: '4px',
21+
bg: this.colorMode === 'light' ? 'gray.50' : 'rgba(36, 70, 93, 0.32)',
22+
color: 'inherit',
23+
'@media (max-width: 480px)': {
24+
fontSize: '0.875em'
25+
},
26+
a: {
27+
textDecoration: 'none',
28+
color: 'inherit',
29+
'&:hover': {
30+
textDecoration: 'underline'
31+
}
32+
},
33+
'.carbon-wrap': {
34+
display: 'flex',
35+
padding: '16px'
36+
},
37+
'.carbon-img': {
38+
marginRight: '16px',
39+
img: {
40+
display: 'block'
41+
}
42+
},
43+
'.carbon-text': {
44+
fontSize: '0.8rem',
45+
lineHeight: 1.4
46+
},
47+
'.carbon-poweredby': {
48+
position: 'absolute',
49+
bottom: '16px',
50+
left: '162px',
51+
color: `${this.theme?.colors.gray[500]} !important`,
52+
display: 'block',
53+
fontSize: '10px',
54+
fontWeight: 'semibold',
55+
textTransform: 'uppercase',
56+
lineHeight: 1,
57+
letterSpacing: '0.2px'
58+
}
59+
})
60+
},
61+
css: vm => styles => Css(styles)(vm.theme)
62+
},
63+
async mounted () {
64+
await this.$nextTick()
65+
const { carbonContainer } = this.$refs
66+
if (!carbonContainer) return
67+
68+
const script = loadScript(
69+
'//cdn.carbonads.com/carbon.js?serve=CEBI5K7I&placement=vuechakra-uicom',
70+
carbonContainer
71+
)
72+
73+
script.id = '_carbonads_js'
74+
script.type = 'text/javascript'
75+
},
76+
render (h) {
77+
return h('span', {
78+
class: this.className,
79+
ref: 'carbonContainer'
80+
})
81+
}
82+
}
83+
84+
export default CarbonAd

website/components/MDXComponents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const MDXComponents = {
6969
name: 'H1',
7070
render () {
7171
return (
72-
<CHeading as="h1" size="2xl" my="1em" { ...props}>
72+
<CHeading as="h1" id="chakra-documentation-title" size="2xl" my="1em" { ...props}>
7373
{this.$slots.default}
7474
</CHeading>
7575
)

website/layouts/default.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ export default {
105105
},
106106
code: {
107107
light: {
108-
color: 'indigo.500'
108+
color: 'indigo.500',
109+
bg: 'indigo.50'
109110
},
110111
dark: {
111-
color: 'indigo.100'
112+
color: 'indigo.500',
113+
bg: 'indigo.50'
112114
}
113115
},
114116
MDXComponents

website/pages/accessibility.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ heavy-lifting for you in order to allow you to focus on building your applicatio
55

66
All authored components are compliant with the WAI-ARIA standards for authored components.
77

8+
<carbon-ad />
9+
810
We've taken the time to write summarized description of the accessibility support for
911
all authored components in @chakra-ui/vue. We called this document an accessibility report
1012
and can be found in the `accessibility.md` file in the respective component's source directory.

website/pages/accordion.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Accordions display a list of high-level options that can expand/collapse to reve
1111

1212
See `CAccordion`'s <a href="https://github.com/chakra-ui/chakra-ui-vue/blob/master/packages/chakra-ui-core/src/CAccordion/accessibility.md">accessibility report</a>
1313

14+
<carbon-ad />
1415

1516
## Imports
1617

website/pages/alert.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Alerts are used to communicate a state that affects a system, feature or page.
1111

1212
See `CAlert`'s <a href="https://github.com/chakra-ui/chakra-ui-vue/blob/master/packages/chakra-ui-core/src/CAlert/accessibility.md">accessibility report</a>
1313

14+
<carbon-ad />
15+
1416
## Import
1517

1618
Chakra UI Vue exports 4 Alert related components.

website/pages/alertdialog.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ or action.
1212

1313
See `CAlertDialog`'s <a href="https://github.com/chakra-ui/chakra-ui-vue/blob/master/packages/chakra-ui-core/src/CAlertDialog/accessibility.md">accessibility report</a>
1414

15+
<carbon-ad />
16+
1517
## Import
1618

1719
Chakra UI exports 7 alert dialog related components.

website/pages/aspectratiobox.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import SEO from '../components/SEO'
1111
`CAspectRatioBox` component is used to embed responsive videos and maps, etc. It
1212
uses a very common [**padding hack**](https://css-tricks.com/aspect-ratio-boxes/) to achieve this.
1313

14+
<carbon-ad />
15+
1416
## Import
1517

1618
```js

website/pages/auto-import-components.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ you to directly consume Chakra UI Vue components without manually importing and
1212

1313
This provides a better developer experience without sacrificing your applications bundle-size performance.
1414

15+
<carbon-ad />
1516

1617
## Installation
1718

website/pages/avatar.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import SEO from '../components/SEO'
99

1010
The `CAvatar` component is used to visually represent a user by displaying their profile picture, initials or a fallback icon.
1111

12+
<carbon-ad />
13+
1214
## Import
1315

1416
Chakra UI Vue exports 3 Avatar related components.

0 commit comments

Comments
 (0)