From f8526136e28c1e83470c508fcf78e7c9f4f589eb Mon Sep 17 00:00:00 2001 From: Yangshun Date: Wed, 16 Mar 2022 09:51:38 +0800 Subject: [PATCH] website: add Carbon --- website/src/components/SidebarAd/index.js | 1 - website/src/css/custom.css | 62 +++++++++++++++++++++++ website/src/theme/DocItem/index.js | 9 +++- 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/website/src/components/SidebarAd/index.js b/website/src/components/SidebarAd/index.js index fe0a44d2..ba38ef30 100644 --- a/website/src/components/SidebarAd/index.js +++ b/website/src/components/SidebarAd/index.js @@ -1,5 +1,4 @@ import React from 'react'; -import ReactDOM from 'react-dom'; import BrowserOnly from '@docusaurus/BrowserOnly'; import clsx from 'clsx'; diff --git a/website/src/css/custom.css b/website/src/css/custom.css index 6791f47c..b19942f0 100755 --- a/website/src/css/custom.css +++ b/website/src/css/custom.css @@ -159,3 +159,65 @@ html[data-theme='dark'] .navbar-icon-telegram:before { height: 28px; width: 24px; } + +#carbonads * { + margin: initial; + padding: initial; +} +#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: hsl(0, 0%, 98%); + box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, 0.1); + z-index: 100; +} +#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; +} +#carbonads .carbon-img { + display: block; + margin: 0; + line-height: 1; +} +#carbonads .carbon-img img { + display: block; +} +#carbonads .carbon-text { + font-size: 13px; + padding: 10px; + margin-bottom: 16px; + line-height: 1.5; + text-align: left; +} +#carbonads .carbon-poweredby { + display: block; + padding: 6px 8px; + background: #f1f1f2; + text-align: center; + text-transform: uppercase; + letter-spacing: 0.5px; + font-weight: 600; + font-size: 8px; + line-height: 1; + border-top-left-radius: 3px; + position: absolute; + bottom: 0; + right: 0; +} diff --git a/website/src/theme/DocItem/index.js b/website/src/theme/DocItem/index.js index d0f7e619..10148ec3 100644 --- a/website/src/theme/DocItem/index.js +++ b/website/src/theme/DocItem/index.js @@ -78,7 +78,14 @@ export default function DocItem(props) { {title} )} - +
+