You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/docs/pages/component-library/custom-components/custom-css-js.mdx
+55Lines changed: 55 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,6 +118,61 @@ For customizing the background, logo, font, and layout of your Docs via Fern's b
118
118
check out the [Global Configuration](/learn/docs/getting-started/global-configuration).
119
119
</Note>
120
120
121
+
## Hiding docs components
122
+
123
+
You can use custom CSS to hide specific Fern docs components that you don't want to display. This is useful for removing UI elements that aren't relevant to your documentation or user experience.
Hide the "Open in ChatGPT" and "Open in Claude" buttons that appear on documentation pages:
130
+
131
+
```css
132
+
.fern-page-actions {
133
+
display: none !important;
134
+
}
135
+
```
136
+
137
+
<Note>
138
+
This is particularly useful for authenticated content where these external AI tools shouldn't have access.
139
+
</Note>
140
+
</Accordion>
141
+
142
+
<Accordiontitle="Other UI elements">
143
+
You can target other Fern UI components using their CSS class names. Use your browser's developer tools to inspect elements and find their class names.
144
+
145
+
Common patterns include:
146
+
- `.fern-*` - Fern-specific components
147
+
- Use `!important` to ensure your styles override default styles
148
+
- Consider both light and dark mode styling if needed
149
+
</Accordion>
150
+
</AccordionGroup>
151
+
152
+
### Finding component selectors
153
+
154
+
To hide other components:
155
+
156
+
<Steps>
157
+
<Steptitle="Inspect the element">
158
+
Right-click on the component you want to hide and select "Inspect Element" in your browser's developer tools.
159
+
</Step>
160
+
161
+
<Steptitle="Find the CSS class">
162
+
Look for CSS classes that start with `fern-` or other identifying class names in the HTML structure.
163
+
</Step>
164
+
165
+
<Steptitle="Add CSS rule">
166
+
Add a CSS rule to your `styles.css` file using the class name:
167
+
168
+
```css
169
+
.component-class-name {
170
+
display: none!important;
171
+
}
172
+
```
173
+
</Step>
174
+
</Steps>
175
+
121
176
## Custom JavaScript
122
177
123
178
Customize the behavior of your Docs site by injecting custom JavaScript globally. Add a `custom.js` file and include it in your `fern/` project:
0 commit comments