Skip to content

Commit 6c46435

Browse files
Documentation updates from Promptless
1 parent 296a938 commit 6c46435

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

fern/products/docs/pages/component-library/custom-components/custom-css-js.mdx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,61 @@ For customizing the background, logo, font, and layout of your Docs via Fern's b
118118
check out the [Global Configuration](/learn/docs/getting-started/global-configuration).
119119
</Note>
120120
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.
124+
125+
### Common components to hide
126+
127+
<AccordionGroup>
128+
<Accordion title="Page actions (ChatGPT/Claude buttons)">
129+
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+
<Accordion title="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+
<Step title="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+
<Step title="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+
<Step title="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+
121176
## Custom JavaScript
122177

123178
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

Comments
 (0)