Skip to content

Commit b14307b

Browse files
committed
styling
1 parent 1688a65 commit b14307b

File tree

1 file changed

+70
-2
lines changed

1 file changed

+70
-2
lines changed

src/theme/DocSidebar/index.tsx

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import DocSidebar from "@theme-original/DocSidebar";
33
import type DocSidebarType from "@theme/DocSidebar";
44
import React, { type ReactNode } from "react";
55

6-
function Carbon() {
6+
export function Carbon() {
77
const ref = React.useRef<HTMLDivElement>(null!);
88

99
React.useEffect(() => {
@@ -16,7 +16,75 @@ function Carbon() {
1616
ref.current.appendChild(s);
1717
}, []);
1818

19-
return <div ref={ref} className="carbon-outer h-[299px]" />;
19+
return (
20+
<>
21+
<style>
22+
{`
23+
#carbonads_1 { display: none; }
24+
#carbonads * { margin: initial; padding: initial; }
25+
#carbonads {
26+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
27+
Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial,
28+
sans-serif;
29+
display: flex;
30+
}
31+
#carbonads a {
32+
text-decoration: none;
33+
color: inherit;
34+
}
35+
#carbonads span {
36+
position: relative;
37+
display: block;
38+
overflow: hidden;
39+
width: 100%;
40+
}
41+
#carbonads .carbon-wrap {
42+
display: flex;
43+
flex-direction: column;
44+
}
45+
#carbonads .carbon-img {
46+
display: block;
47+
margin: 0;
48+
line-height: 1;
49+
}
50+
#carbonads .carbon-img img {
51+
display: block;
52+
height: 100%;
53+
max-width: 100% !important;
54+
width: 100%;
55+
border-radius: 4px;
56+
}
57+
#carbonads .carbon-text {
58+
font-size: 11px;
59+
padding: 10px;
60+
margin-bottom: 16px;
61+
line-height: 1.5;
62+
text-align: left;
63+
}
64+
#carbonads .carbon-poweredby {
65+
display: block;
66+
padding: 6px 8px;
67+
text-align: center;
68+
text-transform: uppercase;
69+
letter-spacing: 0.5px;
70+
font-weight: 600;
71+
font-size: 8px;
72+
line-height: 1;
73+
border-top-left-radius: 3px;
74+
position: absolute;
75+
bottom: 0;
76+
right: 0;
77+
background: rgba(128, 128, 128, 0.1);
78+
}
79+
`}
80+
</style>
81+
<div className="ml-auto flex flex-col space-y-4">
82+
<div className="bg-white dark:bg-black/40 border-gray-500/20 shadow-xl flex flex-col border-t border-l border-b p-4 space-y-2 rounded-l-lg">
83+
<div ref={ref} className="carbon-outer" />
84+
</div>
85+
</div>
86+
</>
87+
);
2088
}
2189

2290
type Props = WrapperProps<typeof DocSidebarType>;

0 commit comments

Comments
 (0)