Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add class names to relevant components for better css targeting #593

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/three-countries-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fumadocs-ui": patch
---

Add data attributes to certain components to improve CSS targeting
1 change: 1 addition & 0 deletions packages/ui/src/components/layout/search-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
return (
<button
type="button"
className={cn(

Check warning on line 16 in packages/ui/src/components/layout/search-toggle.tsx

View workflow job for this annotation

GitHub Actions / lint

Classname 'search-toggle' is not a Tailwind CSS class!
'search-toggle',
buttonVariants({
size: 'icon',
color: 'ghost',
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/components/layout/theme-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
return (
<button
type="button"
className={cn(

Check warning on line 30 in packages/ui/src/components/layout/theme-toggle.tsx

View workflow job for this annotation

GitHub Actions / lint

Classname 'theme-toggle' is not a Tailwind CSS class!
'theme-toggle',
'inline-flex items-center rounded-full border p-0.5',
className,
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/layout/toc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
const { text } = useI18n();

return (
<div className="sticky top-0 flex h-dvh w-[220px] shrink-0 flex-col gap-4 pe-2 pt-12 max-lg:hidden xl:w-[260px]">
<div className="table-of-contents sticky top-0 flex h-dvh w-[220px] shrink-0 flex-col gap-4 pe-2 pt-12 max-lg:hidden xl:w-[260px]">

Check warning on line 41 in packages/ui/src/components/layout/toc.tsx

View workflow job for this annotation

GitHub Actions / lint

Classname 'table-of-contents' is not a Tailwind CSS class!
{header}
<h3 className="-mb-1 -ms-0.5 inline-flex items-center gap-1.5 text-sm text-muted-foreground">
<Text className="size-4" />
Expand Down