forked from mswjs/mswjs.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Carbon ads to the documentation
- Loading branch information
1 parent
9ab7adb
commit d8e19a7
Showing
5 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { useEffect, useRef } from 'react' | ||
import { Box } from 'atomic-layout' | ||
import './carbon-ads.css' | ||
|
||
const CARBON_URL = | ||
'https://cdn.carbonads.com/carbon.js?serve=CEBIV5QY&placement=mswjsio' | ||
|
||
export const CarbonAds: React.FC = () => { | ||
useEffect(() => { | ||
const firstParagraph = document | ||
.getElementById('docs-page') | ||
.querySelector('p') | ||
const element = document.createElement('script') | ||
const container = document.createElement('div') | ||
container.setAttribute('id', 'carbon-container') | ||
|
||
element.setAttribute('src', CARBON_URL) | ||
element.setAttribute('async', 'true') | ||
element.setAttribute('id', '_carbonads_js') | ||
container.appendChild(element) | ||
|
||
firstParagraph.insertAdjacentElement('afterend', container) | ||
// container.appendChild(element) | ||
}, []) | ||
|
||
return null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#carbon-container { | ||
margin: 2rem 0; | ||
min-height: 143px; | ||
} | ||
|
||
#carbonads { | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, | ||
Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, | ||
sans-serif; | ||
} | ||
|
||
#carbonads { | ||
display: flex; | ||
max-width: 330px; | ||
background-color: #fff; | ||
padding: 0.5rem; | ||
border: 1px solid var(--color-gray-dim); | ||
} | ||
|
||
#carbonads a { | ||
color: inherit; | ||
text-decoration: none; | ||
} | ||
|
||
#carbonads a:hover { | ||
color: inherit; | ||
} | ||
|
||
#carbonads span { | ||
position: relative; | ||
display: block; | ||
overflow: hidden; | ||
} | ||
|
||
#carbonads .carbon-wrap { | ||
display: flex; | ||
} | ||
|
||
.carbon-img { | ||
display: block; | ||
margin: 0; | ||
line-height: 1; | ||
} | ||
|
||
.carbon-img img { | ||
display: block; | ||
} | ||
|
||
.carbon-text { | ||
font-size: 13px; | ||
padding: 10px; | ||
line-height: 1.5; | ||
text-align: left; | ||
} | ||
|
||
.carbon-poweredby { | ||
display: block; | ||
padding: 8px 10px; | ||
background: repeating-linear-gradient( | ||
-45deg, | ||
transparent, | ||
transparent 5px, | ||
hsla(0, 0%, 0%, 0.025) 5px, | ||
hsla(0, 0%, 0%, 0.025) 10px | ||
) | ||
hsla(203, 11%, 95%, 0.4); | ||
text-align: center; | ||
text-transform: uppercase; | ||
letter-spacing: 0.5px; | ||
font-weight: 600; | ||
font-size: 9px; | ||
line-height: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters