Upgrade to Tailwind 4.0#1532
Conversation
|
@jjagielka is attempting to deploy a commit to the Themesberg Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThis update primarily focuses on maintenance and styling refinements. The package version and multiple dependency versions in the configuration files have been updated. In the CSS and Svelte component files, many utility classes have been consistently adjusted—such as changing “rounded” to “rounded‑sm”, “focus:outline‑none” to “focus:outline‑hidden”, and “bg-gradient‑to‑r” to “bg‑linear‑to‑r”. Minor configuration updates in PostCSS and type definitions (e.g. transition types) are also included. Documentation examples have been adjusted to reflect these changes. Changes
Sequence Diagram(s)Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
src/app.cssOops! Something went wrong! :( ESLint: 9.20.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js src/lib/accordion/Accordion.svelteOops! Something went wrong! :( ESLint: 9.20.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js src/lib/button-group/ButtonGroup.svelteOops! Something went wrong! :( ESLint: 9.20.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 10
🧹 Nitpick comments (18)
src/routes/landing/DesignFigma.svelte (1)
19-19: Consider removing important modifiersThe use of important modifiers (
!) for padding and justification might make these styles harder to override. Consider using Tailwind's built-in customization options instead.- <Button color="light" class="self-stretch max-w-lg px-4! justify-start! gap-5 sm:gap-7" size="xl" + <Button color="light" class="self-stretch max-w-lg px-4 justify-start gap-5 sm:gap-7" size="xl"Also applies to: 23-23
src/routes/utils/CompoCard.svelte (1)
23-23: Remove redundantblockclass.The
blockclass is unnecessary asdivelements are block-level by default.- <div class="block relative dark:hidden h-5/6 {thumnailSize ? thumnailSize : 'w-56'}"> + <div class="relative dark:hidden h-5/6 {thumnailSize ? thumnailSize : 'w-56'}">src/lib/forms/Radio.svelte (1)
19-19: Consider accessibility implications of rounded corners on radio buttons.While updating to
rounded-smis consistent with the Tailwind 4.0 upgrade, ensure this change doesn't affect the visual distinction of radio buttons, which traditionally have a circular appearance.Consider keeping radio buttons circular for better user experience and accessibility:
-rounded && 'rounded-sm' +rounded && 'rounded-full'src/lib/buttons/GradientButton.svelte (1)
54-59: Consider reducing reliance on !important modifiers.The extensive use of !important modifiers in
gradientOutlineClasscould make the styles harder to override and maintain. Consider refactoring to use more specific selectors or a different class structure.src/routes/docs/forms/search-input.md (3)
53-53: Enforce Correct Tailwind Modifier Syntax for Simple Search ButtonThe padding utility modifier has been changed from a leading exclamation mark to a trailing one (from
!p-2.5top-2.5!). Verify that Tailwind 4.0 accepts the trailing syntax as intended and that it applies the “important” flag as expected.
110-112: Ensure Consistent Modifier Application in Dropdown ButtonIn the dropdown example, the button’s class now reads
p-2.5! rounded-s-none. As with the simple search input, please confirm that the new trailing exclamation mark syntax is valid in Tailwind 4.0 and consistently overrides the padding as desired.
197-197: Verify Update to Outline Class for Voice Search ButtonThe voice search button now uses
outline-hiddeninstead ofoutline-none. Confirm that this new class is supported in Tailwind 4.0 and that it removes the outline in the intended manner.src/routes/docs/components/alert.md (2)
156-161: Tailwind Modifier Order – Alert without color
The class attribute has been updated from using a leading modifier (!items-start) to a trailing modifier (items-start!). This change appears to follow Tailwind CSS v4.0 conventions for class overrides. Please verify that the alignment of alert content remains as expected.
168-174: Tailwind Modifier Order – Colored Alert
Similarly, the Alert with a color prop now usesitems-start!instead of a leading bang. This consistent update should align with the new Tailwind merge behavior. Confirm that the icon and text positioning in colored alerts is correct.src/routes/docs/components/navbar.md (1)
160-163: Updated Focus Outline Class on Search Button
The Button in the “Navbar with search” example now usesfocus:outline-hiddeninstead offocus:outline-none. This change is consistent with the styling updates for Tailwind CSS v4.0 focus states. Please double-check that the modified focus style still provides clear visual feedback for accessibility.src/routes/docs/forms/input-field.md (2)
361-365: Updated Flex Shrink Class for Dropdown Button
The class for the dropdown Button has been changed fromflex-shrink-0toshrink-0. This update aligns with the new Tailwind CSS utility naming conventions. Verify that the button’s sizing and alignment remain appropriate in the layout.
372-375: Reordered Padding Modifier for Submit Button
The padding modifier is now written asp-2.5!(with the exclamation mark trailing) instead of!p-2.5. This change should help Tailwind correctly merge the utility classes. Please confirm that the resulting spacing is as intended.src/routes/docs/components/card.md (2)
274-274: Revised Dark Mode Background Modifier on Listgroup
The Listgroup component’s class was updated from usingdark:!bg-transparenttodark:bg-transparent!. This subtle change in modifier ordering should correctly apply the background override in dark mode. Ensure that the Listgroup’s background remains transparent as desired under dark mode.
276-276: Updated Flex Shrink Utility for Avatar
The Avatar component now usesshrink-0instead offlex-shrink-0, aligning with the updated Tailwind CSS utility naming conventions. Please verify that the avatar sizing remains consistent within flex layouts.src/routes/docs/components/bottom-navigation.md (4)
204-208: Updated Focus Outline in Application Bar CTA Button
In the “Application bar example,” the "Create new item" BottomNavItem now usesfocus:outline-hidden(and the corresponding focus ring classes) in its btnClass. This update should harmonize focus styling throughout the app. Confirm that the button’s focus behavior remains both accessible and visually appealing.
244-248: Consistent Focus Outline Update on Pagination (Left Button)
The pagination button on the left now usesfocus:outline-hiddeninstead of the previous outline class, ensuring consistency with the new focus styling practices. Please test for proper focus visibility and keyboard navigation.
249-253: Consistent Focus Outline Update on Pagination (Right Button)
Similarly, the right pagination button correctly appliesfocus:outline-hidden. Ensure all pagination controls provide sufficient visual feedback for focus states in both light and dark modes.
346-348: Revised Classes in Card with Bottom Bar Example
Within the “Card with bottom bar” example, the Listgroup now usesclass="border-0 dark:bg-transparent!"and the Avatar usesclass="shrink-0 me-3". These changes mirror earlier updates for dark mode background and flex shrink classes. Please verify that the list and avatar display correctly inside the scrollable card container.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (107)
package.json(3 hunks)postcss.config.js(1 hunks)src/app.css(2 hunks)src/lib/accordion/Accordion.svelte(2 hunks)src/lib/accordion/AccordionItem.svelte(1 hunks)src/lib/avatar/Avatar.svelte(3 hunks)src/lib/badge/Badge.svelte(3 hunks)src/lib/banner/Banner.svelte(2 hunks)src/lib/button-group/ButtonGroup.svelte(2 hunks)src/lib/buttons/Button.svelte(4 hunks)src/lib/buttons/GradientButton.svelte(3 hunks)src/lib/cards/Card.svelte(1 hunks)src/lib/carousel/ControlButton.svelte(1 hunks)src/lib/carousel/Slide.svelte(1 hunks)src/lib/darkmode/DarkMode.svelte(2 hunks)src/lib/datepicker/Datepicker.svelte(1 hunks)src/lib/drawer/Drawer.svelte(3 hunks)src/lib/dropdown/Dropdown.svelte(2 hunks)src/lib/footer/Footer.svelte(1 hunks)src/lib/forms/CheckboxButton.svelte(2 hunks)src/lib/forms/Fileupload.svelte(2 hunks)src/lib/forms/FloatingLabelInput.svelte(2 hunks)src/lib/forms/Input.svelte(1 hunks)src/lib/forms/InputAddon.svelte(1 hunks)src/lib/forms/MultiSelect.svelte(1 hunks)src/lib/forms/Radio.svelte(1 hunks)src/lib/forms/RadioButton.svelte(2 hunks)src/lib/forms/Select.svelte(3 hunks)src/lib/forms/Textarea.svelte(2 hunks)src/lib/forms/Toggle.svelte(1 hunks)src/lib/indicators/Indicator.svelte(3 hunks)src/lib/list-group/ListgroupItem.svelte(2 hunks)src/lib/mega-menu/MegaMenu.svelte(1 hunks)src/lib/modal/Modal.svelte(2 hunks)src/lib/navbar/NavLi.svelte(1 hunks)src/lib/navbar/NavUl.svelte(2 hunks)src/lib/pagination/PaginationItem.svelte(1 hunks)src/lib/popover/Popover.svelte(1 hunks)src/lib/rating/AdvancedRating.svelte(2 hunks)src/lib/rating/Review.svelte(1 hunks)src/lib/rating/ScoreRating.svelte(4 hunks)src/lib/sidebar/SidebarCta.svelte(2 hunks)src/lib/sidebar/SidebarDropdownWrapper.svelte(1 hunks)src/lib/sidebar/SidebarWrapper.svelte(2 hunks)src/lib/skeleton/CardPlaceholder.svelte(2 hunks)src/lib/skeleton/ImagePlaceholder.svelte(1 hunks)src/lib/skeleton/ListPlaceholder.svelte(2 hunks)src/lib/skeleton/WidgetPlaceholder.svelte(2 hunks)src/lib/speed-dial/SpeedDial.svelte(2 hunks)src/lib/speed-dial/SpeedDialButton.svelte(2 hunks)src/lib/steps/StepIndicator.svelte(1 hunks)src/lib/table/Table.svelte(2 hunks)src/lib/table/TableBodyRow.svelte(1 hunks)src/lib/tabs/Tabs.svelte(1 hunks)src/lib/timeline/ActivityItem.svelte(2 hunks)src/lib/toast/Toast.svelte(2 hunks)src/lib/toolbar/ToolbarButton.svelte(1 hunks)src/lib/toolbar/ToolbarGroup.svelte(2 hunks)src/lib/types.ts(1 hunks)src/lib/typography/Mark.svelte(2 hunks)src/lib/typography/Span.svelte(2 hunks)src/lib/utils/backdrop.ts(1 hunks)src/routes/component-data/Drawer.json(1 hunks)src/routes/component-data/Modal.json(1 hunks)src/routes/docs/components/alert.md(3 hunks)src/routes/docs/components/avatar.md(2 hunks)src/routes/docs/components/badge.md(2 hunks)src/routes/docs/components/banner.md(3 hunks)src/routes/docs/components/bottom-navigation.md(3 hunks)src/routes/docs/components/button-group.md(4 hunks)src/routes/docs/components/buttons.md(1 hunks)src/routes/docs/components/card.md(1 hunks)src/routes/docs/components/carousel.md(2 hunks)src/routes/docs/components/drawer.md(2 hunks)src/routes/docs/components/dropdown.md(8 hunks)src/routes/docs/components/footer.md(1 hunks)src/routes/docs/components/indicators.md(2 hunks)src/routes/docs/components/modal.md(1 hunks)src/routes/docs/components/navbar.md(1 hunks)src/routes/docs/components/table.md(8 hunks)src/routes/docs/components/tabs.md(1 hunks)src/routes/docs/components/timeline.md(1 hunks)src/routes/docs/extend/CheckCircle.svelte(1 hunks)src/routes/docs/forms/checkbox.md(2 hunks)src/routes/docs/forms/input-field.md(2 hunks)src/routes/docs/forms/radio.md(2 hunks)src/routes/docs/forms/search-input.md(4 hunks)src/routes/docs/forms/select.md(2 hunks)src/routes/docs/pages/customization.md(1 hunks)src/routes/docs/plugins/charts.md(6 hunks)src/routes/docs/typography/blockquote.md(2 hunks)src/routes/docs/typography/hr.md(1 hunks)src/routes/docs/typography/image.md(1 hunks)src/routes/docs/typography/list.md(5 hunks)src/routes/landing/CTA.svelte(1 hunks)src/routes/landing/DesignFigma.svelte(1 hunks)src/routes/landing/GetStarted.svelte(1 hunks)src/routes/landing/Hero.svelte(1 hunks)src/routes/landing/utils/Row.svelte(1 hunks)src/routes/layouts/ComponentsLayout.svelte(2 hunks)src/routes/layouts/FlowbiteSvelteLayout.svelte(4 hunks)src/routes/utils/CompoCard.svelte(2 hunks)src/routes/utils/ExampleDarkMode.svelte(1 hunks)src/routes/utils/ExampleRTL.svelte(1 hunks)src/routes/utils/ExampleWrapper.svelte(4 hunks)src/routes/utils/GitHubSourceList.svelte(1 hunks)src/routes/utils/Newsletter.svelte(1 hunks)
⛔ Files not processed due to max files limit (3)
- src/routes/utils/TableDefaultRow.svelte
- static/styles/docs.css
- tailwind.config.ts
✅ Files skipped from review due to trivial changes (28)
- src/lib/rating/Review.svelte
- src/lib/forms/MultiSelect.svelte
- src/routes/layouts/ComponentsLayout.svelte
- src/lib/navbar/NavLi.svelte
- src/routes/docs/forms/checkbox.md
- src/routes/docs/extend/CheckCircle.svelte
- src/routes/docs/components/buttons.md
- src/routes/docs/typography/list.md
- src/routes/component-data/Modal.json
- src/lib/utils/backdrop.ts
- src/lib/datepicker/Datepicker.svelte
- src/lib/typography/Span.svelte
- src/routes/docs/components/dropdown.md
- src/routes/docs/components/table.md
- src/lib/speed-dial/SpeedDial.svelte
- src/routes/docs/components/modal.md
- src/routes/landing/utils/Row.svelte
- src/lib/forms/Fileupload.svelte
- src/routes/utils/GitHubSourceList.svelte
- src/routes/utils/ExampleRTL.svelte
- src/lib/sidebar/SidebarWrapper.svelte
- src/routes/docs/forms/radio.md
- src/lib/modal/Modal.svelte
- src/lib/skeleton/ImagePlaceholder.svelte
- src/lib/toast/Toast.svelte
- src/lib/steps/StepIndicator.svelte
- src/lib/rating/AdvancedRating.svelte
- src/routes/docs/plugins/charts.md
🔇 Additional comments (113)
src/lib/sidebar/SidebarCta.svelte (2)
14-14: LGTM! Consistent with Tailwind 4.0 upgrade.The change from
roundedtorounded-smaligns with the standardization of border radius styles across components in the Tailwind 4.0 upgrade.
34-34: LGTM! Documentation updated correctly.The documentation comment has been properly synchronized with the code changes, maintaining accurate API documentation.
src/lib/footer/Footer.svelte (1)
11-11: LGTM! Shadow class update aligns with Tailwind 4.0 upgrade.The change from
shadowtoshadow-smfor both 'logo' and 'default' footer types is consistent with the PR's objective of upgrading to Tailwind 4.0.src/routes/docs/components/footer.md (1)
222-222: LGTM! Documentation updated to match component changes.The sticky footer example correctly reflects the updated
shadow-smclass, maintaining consistency with the component implementation.src/lib/rating/ScoreRating.svelte (3)
22-22: LGTM! Consistent with Tailwind upgrade.The changes from
roundedtorounded-smin the default values ofdesc1ClassandbarColorprops align with the Tailwind 4.0 upgrade.Also applies to: 27-27
51-51: LGTM! Consistent styling across rating groups.The background containers for both rating groups have been updated to use
rounded-sm, maintaining visual consistency with the progress bars.Also applies to: 64-64
81-81: LGTM! Documentation matches implementation.The prop documentation has been correctly updated to reflect the new default values using
rounded-sm.Also applies to: 86-86
src/routes/docs/components/tabs.md (1)
235-235: Refined Shadow Class for Consistent StylingThe change from using
shadowtoshadow-smin thedefaultClassattribute provides a more subtle shadow effect, aligning with the overall visual update in Tailwind CSS 4.0. This update ensures consistency with similar changes applied across other components in the project.src/routes/docs/components/drawer.md (2)
95-97: Tailwind Upgrade: Adjusted Border RadiusThe update changes the SidebarWrapper’s
divClassfrom"overflow-y-auto py-4 px-3 rounded dark:bg-gray-800"to"overflow-y-auto py-4 px-3 rounded-sm dark:bg-gray-800". This subtle modification aligns with the Tailwind CSS 4.0 design adjustments by providing a slightly less rounded appearance. Please verify that this visual change is consistent with the overall UI design and that similar components (if any) adopt the same rounded style for a cohesive look.
246-248: Tailwind Upgrade: Updated Focus Outline ClassThe Button component now uses
focus:outline-hiddeninstead offocus:outline-none. This update reflects the changes in Tailwind CSS 4.0 regarding focus outline utilities. Please ensure thatfocus:outline-hiddenprovides the intended visual feedback and maintains accessibility standards across browsers.src/lib/forms/Toggle.svelte (1)
29-29:Details
❓ Verification inconclusive
Great addition of RTL support!
The addition of RTL support for the toggle animation improves accessibility for right-to-left languages while maintaining the existing LTR behavior.
Let's verify the RTL implementation works as expected:
🏁 Script executed:
#!/bin/bash # Description: Check for consistent RTL support across toggle components and similar UI elements # Search for other toggle-like components that might need RTL support rg -l "translate-x-full" --type svelte # Check if RTL support is consistently implemented rg "rtl:.*translate-x" --type svelteLength of output: 139
Impressive RTL enhancement!
The update to the
commonconstant insrc/lib/forms/Toggle.sveltenow correctly applies Tailwind’s RTL modifier (rtl:after:-translate-x-full) to ensure the toggle animation behaves as expected in right-to-left contexts while preserving the default LTR functionality.One minor note: our initial verification attempt using
rg --type sveltefailed due to the unrecognized file type. Please re-run the checks manually or with an adjusted command (for example, using a glob pattern withrg -g "*.svelte" …) to ensure consistent RTL usage across similar components.
- Updated line in src/lib/forms/Toggle.svelte (Line 29) now leverages RTL support appropriately.
- Action: Manually verify that the RTL functionality works as intended, especially in environments or tests that simulate RTL layouts.
src/lib/pagination/PaginationItem.svelte (1)
29-29:Details
❓ Verification inconclusive
LGTM! Verify consistency of rounded utilities.
The change from
roundedtorounded-smaligns with the Tailwind upgrade and maintains the component's conditional styling logic.Let's verify the consistency of rounded utilities across other components:
🏁 Script executed:
#!/bin/bash # Description: Check for any remaining 'rounded' classes that might need updating to 'rounded-sm' # Note: Excluding common patterns like 'rounded-lg', 'rounded-full', etc. rg -g '*.svelte' '\brounded\b(?!-)'Length of output: 268
LGTM! Please perform a manual verification to confirm rounded class consistency.
The update from
roundedtorounded-smfor thetablebranch aligns with the Tailwind v4.0 upgrade and preserves the intended conditional styling logic. However, the initial automated check for stray bareroundedclasses using:rg -g '*.svelte' '\brounded\b(?!-)'failed due to regex look-around limitations. To re-check consistency, please run the query with PCRE2 enabled:
rg --pcre2 -g '*.svelte' '\brounded\b(?!-)'If no unexpected
roundedoccurrences are reported, the changes are confirmed to be consistent.src/routes/layouts/FlowbiteSvelteLayout.svelte (4)
26-27: LGTM!The addition of the semicolon improves code style consistency.
95-95:Details
❓ Verification inconclusive
Verify dark mode functionality.
The removal of
dark:bg-gray-900class might affect the dark mode experience. Please ensure this change was intentional and test the component in both light and dark modes.Run the following script to check for other dark mode class removals that might need attention:
🏁 Script executed:
#!/bin/bash # Search for recent changes to dark mode classes rg -A 5 'dark:bg-gray-900'Length of output: 11127
Verify dark mode functionality.
The simplified class on the<div class="lg:flex w-full">in FlowbiteSvelteLayout removes the explicitdark:bg-gray-900styling. Since other parts of the repository continue to usedark:bg-gray-900for dark mode support (as seen in files likesrc/app.html,src/lib/buttons/GradientButton.svelte, and others), please confirm that this removal in FlowbiteSvelteLayout was intentional. Additionally, ensure that the overall dark mode experience remains consistent by manually testing the layout in both light and dark modes.
63-63:Details
❓ Verification inconclusive
Verify the NavUl style changes.
The addition of
!suffixes to force style precedence appears to address the NavUl hidden state issue mentioned in the PR objectives. However, using force modifiers extensively might indicate underlying specificity issues.Consider running the following script to check for similar patterns that might need attention:
🏁 Script executed:
#!/bin/bash # Search for other potential specificity issues in NavUl components rg -A 5 'NavUl.*class=.*!'Length of output: 28
Verify NavUl Specificity and Forced Style Modifiers
The changes to
nonActiveClassandactiveClassusing the forced!suffixes appear to address the hidden state issue in the NavUl component. Our search for similar forced style patterns did not yield any additional instances, suggesting this change is localized. However, please manually verify that the force modifiers do not cause unwanted specificity conflicts elsewhere in the application.
45-95:Details
❓ Verification inconclusive
Verify Tailwind 4.0 class compatibility.
As part of the Tailwind 4.0 upgrade, please ensure all class names in this component are compatible with the new version.
🌐 Web query:
What are the breaking changes in Tailwind CSS 4.0 that affect class names?💡 Result:
Tailwind CSS 4.0 introduces several breaking changes affecting class names and usage patterns:
1. Removed Deprecated Utilities
Key deprecated classes replaced by new syntax:
text-opacity-*→ Use slash notation:text-black/50[4][9]flex-grow-*→ Simplified togrow-*[4][6]decoration-slice→ Replaced bybox-decoration-slice[4]overflow-ellipsis→ Unified astext-ellipsis[9]2. Dynamic Class Name Restrictions
Template literal patterns like
className={`mt-[${value}px]`}now require explicit safelisting or static values due to stricter content detection rules[2][7]. This affects runtime-generated arbitrary values that worked in v3.3. Class Renaming Conventions
Standardized naming patterns across utilities:
Old Class New Class shadow-sm shadow-xs ring-3 ring flex-shrink shrink 4. Color/Opacity Syntax Changes
Merged opacity handling using CSS-native syntax:
<!-- Before --> <div class="bg-blue-500 bg-opacity-50"> <!-- After --> <div class="bg-blue-500/50">Requires updating all opacity-related classes[9][7].
5. Custom Utility Declaration
New
@utilitydirective replaces layer-based customization:/* Before */ @layer utilities { .tab-4 { tab-size: 4; }} /* After */ @utility tab-4 { tab-size: 4; }Existing layer-based custom utilities will break[7][9].
6. Default Style Resets
Headings and form elements lost default styles:
<h1>-<h6>no longer have default font sizes/weights- Buttons/inputs require explicit styling[8]
<!-- Must now add --> <button class="bg-gray-100 px-4 py-2 rounded">7. Theme Configuration Shift
Color palette classes now use CSS variables:
/* Before: JS config */ // tailwind.config.js theme: { colors: { avocado: { 100: '#...' } } } /* After: CSS variables */ @theme { --color-avocado-100: oklch(0.99 0 0); }Existing JS-based color configurations require migration[1][7].
These changes reflect Tailwind's move toward CSS-native implementation and stricter class validation. The official upgrade tool automates many migrations, but manual verification is recommended for dynamic class patterns and custom utilities[1][7].
Citations:
- 1: https://tailwindcss.com/blog/tailwindcss-v4
- 2: tailwindlabs/tailwindcss#16159
- 3: https://www.youtube.com/watch?v=7IK9j9-H0vQ
- 4: https://daily.dev/blog/tailwind-css-40-everything-you-need-to-know-in-one-place
- 5: tailwindlabs/tailwindcss#8441
- 6: https://v3.tailwindcss.com/docs/v4-beta
- 7: https://tailwindcss.com/docs/upgrade-guide
- 8: tailwindlabs/tailwindcss#16517
- 9: https://dev.to/kasenda/whats-new-and-migration-guide-tailwind-css-v40-3kag
- 10: https://www.youtube.com/watch?v=bupetqS1SMU
Tailwind 4.0 Compatibility Check for FlowbiteSvelteLayout
Please verify that all utility classes—especially those applied conditionally—are correctly recognized by Tailwind 4.0. Notably:
- Dynamic Classes: The conditional classes used with
<Navbar>(e.g.lg:px-0,max-w-7xl,mx-auto) may need to be explicitly safelisted or refactored to ensure Tailwind’s new JIT engine picks them up.- Logical Properties: Classes like
ms-auto,ms-2, andms-3should be reviewed to confirm they work as intended with your Tailwind configuration.- Deprecated/Renamed Utilities: Although no deprecated utilities (like
text-opacity-*,flex-grow-*, etc.) appear in this snippet, please double-check that no other parts of the component use outdated classes under the new Tailwind 4.0 guidelines.postcss.config.js (1)
3-3:Details
✅ Verification successful
Verify the plugin configuration for browser compatibility.
The change removes the
autoprefixerplugin. Please verify if@tailwindcss/postcssincludes autoprefixer functionality or if we need to add it back.
🌐 Web query:
Does @tailwindcss/postcss include autoprefixer functionality in Tailwind CSS 4.0?💡 Result:
In Tailwind CSS 4.0, autoprefixer is no longer required when using
@tailwindcss/postcssbecause vendor prefixing is now handled automatically by Lightning CSS[1][3][6][7]. This integration replaces the need for separate tools likeautoprefixerandpostcss-import.Key points:
- Built-in prefixing: Lightning CSS (now integrated into Tailwind CSS v4) automatically adds necessary browser prefixes[1][7].
- Simplified configuration: The official upgrade guide explicitly states you should remove
autoprefixerfrom your PostCSS plugins when migrating[3].- Unified toolchain: Features like vendor prefixing and
@importhandling are now managed internally through@tailwindcss/postcss[6][7].Example updated PostCSS configuration without
autoprefixer:export default { plugins: { '@tailwindcss/postcss': {} } }For existing projects, the Tailwind team provides an automated upgrade tool to help remove deprecated dependencies like
autoprefixer[1][3].Citations:
- 1: https://tailwindcss.com/blog/tailwindcss-v4
- 2: https://rsbuild.dev/guide/basic/tailwindcss
- 3: https://tailwindcss.com/docs/upgrade-guide
- 4: https://dev.to/falselight/tailwindcss-version-400-has-been-released-29pp
- 5: tailwindlabs/tailwindcss#15735
- 6: https://daily.dev/blog/tailwind-css-40-everything-you-need-to-know-in-one-place
- 7: https://tailwindcss.com/blog/tailwindcss-v4-alpha
- 8: tailwindlabs/tailwindcss#15518
- 9: https://tailwindcss.com/docs/using-with-preprocessors
- 10: tailwindlabs/tailwindcss#15764
Plugin configuration verified: Autoprefixer removal is appropriate.
Based on Tailwind CSS v4 documentation,
@tailwindcss/postcssnow automatically handles vendor prefixing via Lightning CSS. This change eliminates the need for a separate autoprefixer plugin in your PostCSS configuration.No modifications are required in the current configuration.
src/lib/toolbar/ToolbarGroup.svelte (1)
5-5: LGTM! Improved class order for better specificity.The change from
first:sm:ps-0tosm:first:ps-0follows Tailwind's recommended class order, ensuring proper specificity in responsive designs.Also applies to: 19-19
src/lib/button-group/ButtonGroup.svelte (1)
13-13:Details
✅ Verification successful
Verify the shadow utility class.
The change from
shadow-smtoshadow-xsneeds verification to ensure it's a valid class in Tailwind 4.0.Also applies to: 27-27
🌐 Web query:
Is shadow-xs a valid utility class in Tailwind CSS 4.0?💡 Result:
Yes,
shadow-xsis a valid utility class in Tailwind CSS 4.0[3][7][8]. This class was introduced as part of the framework's renaming strategy to improve clarity and consistency across size-related utilities[3][8].Key details about
shadow-xs:
- Replaces the v3
shadow-smclass[3][8]- Applies a subtle box-shadow effect with these CSS properties:
box-shadow: var(--shadow-xs); /* 0 1px 2px 0 rgb(0 0 0 / 0.05) */[7]- Sits at the lower end of the new shadow scale that now includes:
shadow-2xs(new smallest)shadow-xsshadow-sm(formerlyshadow)[7]The change was implemented to create better alignment between different utility categories (shadows, radii, blurs) and allow for more granular control[3][8]. When upgrading from v3, existing
shadow-smclasses should be replaced withshadow-xsto maintain equivalent styling[3][8].Citations:
- 1: https://tailwindcss.com/docs/styling-with-utility-classes
- 2: https://bryananthonio.com/blog/configuring-tailwind-css-v4/
- 3: https://tailwindcss.com/docs/upgrade-guide
- 4: https://tailwindcss.com/blog/tailwindcss-v4
- 5: https://tailwindcss.com
- 6: shadcn-ui/ui#2996
- 7: https://tailwindcss.com/docs/box-shadow
- 8: https://dev.to/kasenda/whats-new-and-migration-guide-tailwind-css-v40-3kag
- 9: https://shuffle.dev/tailwind/classes/shadows/shadow-xs
- 10: tailwindlabs/tailwindcss#16429
Tailwind CSS Shadow Utility Verified
The change from
shadow-smtoshadow-xsis valid for Tailwind CSS 4.0. The newshadow-xsclass replaces the previousshadow-smas part of the v4 renaming strategy. This has been confirmed by the latest documentation and upgrade guides (e.g., [3], [7], [8]). No further action is needed.
- File Affected:
src/lib/button-group/ButtonGroup.svelte- Lines Updated: 13 and 27
src/lib/typography/Mark.svelte (1)
13-13: LGTM! Consistent styling update.The change from
roundedtorounded-smaligns with the broader styling updates in the Tailwind 4.0 upgrade.Also applies to: 26-26
src/lib/popover/Popover.svelte (1)
15-15: LGTM: Class syntax updated for Tailwind 4.0The change from
dark:!border-gray-600todark:border-gray-600!aligns with Tailwind 4.0's new modifier syntax where the important (!) modifier is placed at the end of the class.src/routes/landing/GetStarted.svelte (1)
16-16: LGTM: Class syntax updated for Tailwind 4.0The change from
md:!w-80tomd:w-80!aligns with Tailwind 4.0's new modifier syntax where the important (!) modifier is placed at the end of the class.src/lib/skeleton/WidgetPlaceholder.svelte (1)
8-8: LGTM: Design system updates for Tailwind 4.0The changes to
rounded-smandshadow-smalign with Tailwind 4.0's design system updates, providing more consistent visual styling across components.Also applies to: 30-30
src/lib/carousel/ControlButton.svelte (1)
8-8:Details
✅ Verification successful
Verify accessibility impact of focus outline changes.
The change from
focus:outline-nonetofocus:outline-hiddenmight affect keyboard navigation accessibility. Let's verify if this is a recommended change in Tailwind 4.0.Also applies to: 13-13
🌐 Web query:
What is the difference between focus:outline-none and focus:outline-hidden in Tailwind CSS 4.0?💡 Result:
In Tailwind CSS 4.0,
focus:outline-noneandfocus:outline-hiddenserve distinct purposes related to accessibility and styling:
focus:outline-none
- Removes browser default outlines by setting
outline-style: none- Not recommended for accessibility as it completely hides focus indicators
- Should only be used when replacing default outlines with custom focus styles[8]
focus:outline-hidden
- Maintains accessibility by using a transparent 2px outline
- Ensures visibility in Windows High Contrast Mode
- Replaces the old
outline-nonebehavior from v3[8][1][4]Key comparison table:
Utility Outline Style Accessibility Safe v3 Equivalent outline-nonenone❌ New in v4 outline-hiddenTransparent 2px ✅ Old outline-noneThe change was made to clarify intent: use
outline-hiddenwhen you want to hide visual outlines while preserving accessibility, andoutline-noneonly when completely removing outlines (with proper alternative focus styling)[8]. Always pair these utilities with custom focus indicators likefocus:ringorfocus:borderfor accessibility compliance[1][6].Citations:
- 1: https://v3.tailwindcss.com/docs/outline-style
- 2: https://tailgrids.com/blog/tailwind-css-advanced-techniques-and-tips
- 3: https://tailwindcss.com/docs/outline-width
- 4: https://tailwind-search.barvian.me/docs/outline-style
- 5: https://v1.tailwindcss.com/docs/pseudo-class-variants
- 6: https://tailwindcss.com/docs/hover-focus-and-other-states
- 7: https://tw-elements.com/learn/te-foundations/tailwind-css/focus-active-and-others/
- 8: https://tailwindcss.com/docs/upgrade-guide
- 9: https://v3.tailwindcss.com/docs/hover-focus-and-other-states
- 10: https://www.charlievuong.com/demystifing-tailwind-borders-outlines-and-rings
Accessibility Verification: Focus Outline Update Confirmed
The update from
focus:outline-nonetofocus:outline-hiddenin Tailwind CSS 4.0 is valid. As per the Tailwind guidelines,focus:outline-hiddenapplies a transparent 2px outline—which helps maintain accessibility (e.g., in Windows High Contrast Mode)—instead of completely removing the focus indicator. This change is appropriate provided that any necessary custom focus styles (such as usingfocus:ringor similar utilities) are in place elsewhere in the design.
- Files Affected:
src/lib/carousel/ControlButton.svelte(lines 8 and 13)- Action: Verify that alternative focus indicators are provided where required.
src/lib/forms/InputAddon.svelte (1)
39-39:Details
✅ Verification successful
Verify new Tailwind 4.0 utility class.
The change from
&:not(:first-child)tonot-firstappears to be using a new Tailwind 4.0 utility class. Let's verify this is a valid class in the new version.
🌐 Web query:
Does Tailwind CSS 4.0 introduce a not-first utility class?💡 Result:
Tailwind CSS 4.0 introduces a
not-*variant that allows styling elements when they don’t match another condition[1][5]. While there isn’t an explicitnot-firstutility class, you can achieve this behavior by composing variants:<div class="not-first:bg-red-500"> <!-- Elements styled when they are not the first child --> </div>This leverages Tailwind’s new composable variants system[5], where:
not-*acts as a negation operator- It can target existing positional variants like
first:,last:, or custom selectorsFor example:
<ul> <li class="py-2 not-first:border-t">Item 1</li> <li class="py-2 not-first:border-t">Item 2</li> </ul>In this case, all list items except the first will have a top border[1][5].
The implementation relies on modern CSS features like
:not(:first-child)under the hood[1][5]. This aligns with Tailwind 4.0’s focus on leveraging native CSS capabilities while maintaining developer convenience[1][3][4].Citations:
- 1: https://tailwindcss.com/blog/tailwindcss-v4
- 2: https://laravel-news.com/tailwind-css-v4-is-now-released
- 3: https://daily.dev/blog/tailwind-css-40-everything-you-need-to-know-in-one-place
- 4: https://devclass.com/2025/01/24/tailwind-css-4-0-released-with-ground-up-rewrite-for-faster-rust-powered-build/
- 5: https://tailwindcss.com/blog/tailwindcss-v4-alpha
- 6: https://tailwindcss.com/blog/tailwindcss-v4-beta
- 7: https://blog.logrocket.com/getting-ready-tailwind-v4/
- 8: https://dev.to/best_codes/exciting-updates-in-tailwind-version-4-40i0
- 9: tailwindlabs/tailwindcss#16429
- 10: https://www.youtube.com/watch?v=ud913ekwAOQ
Tailwind "not-first:" Variant Verified
The update correctly replaces the old
&:not(:first-child)selector with Tailwind CSS 4.0's new composable variant syntax. Even though Tailwind doesn’t introduce a dedicated utility class namednot-first, using the variant prefix (as innot-first:-ms-px) is the intended approach to style non-first elements.
- File: src/lib/forms/InputAddon.svelte
- Line: 39
No further changes are needed.
src/routes/landing/Hero.svelte (1)
31-31: LGTM! Improved dark mode image visibility.The change from
hiddentoblockcorrectly implements the visibility toggle for dark mode images.src/lib/forms/RadioButton.svelte (1)
25-25: LGTM: Shadow prop type update aligns with Tailwind 4.0The update to
shadow-smtype is consistent with Tailwind 4.0's shadow utilities and has been properly updated in both the prop declaration and documentation.Also applies to: 63-63
src/lib/mega-menu/MegaMenu.svelte (2)
25-25: LGTM: Important modifier syntax updatedThe change from
!ml-0toml-0!follows Tailwind 4.0's important modifier syntax.
31-32:Details
❓ Verification inconclusive
Verify CSS variable for breakpoint
The change from
max-w-screen-mdtomax-w-(--breakpoint-md)uses a CSS variable. Ensure this variable is defined in your theme configuration.
🏁 Script executed:
#!/bin/bash # Search for breakpoint variable definition rg --type css --type html "breakpoint-md"Length of output: 41
Action Required: Confirm CSS Variable Definition
The automated search for "breakpoint-md" yielded no results, so it's unclear whether the CSS variable
--breakpoint-mdis defined. Please manually verify that this variable is declared in your theme configuration (or an equivalent styling configuration file). You might need to search in configuration files (e.g., Tailwind, Sass, or custom CSS files) where theme variables are set.
- File:
src/lib/mega-menu/MegaMenu.svelte(lines 31-32)- Code Context:
<Popper color={full ? 'default' : 'dropdown'} border={!full} rounded-sm={!full} activeContent arrow={false} trigger="click" placement="bottom" yOnly={full} {...$$restProps} class={wrapperClass} on:show bind:open> <div class="flex flex-col md:flex-row p-4 max-w-(--breakpoint-md) justify-center mx-auto mt-2">- Next Steps:
- Verify manually that
--breakpoint-mdis defined in your CSS or theme configuration.- Update the configuration if missing, or adjust the code to reference the correct variable.
src/lib/table/TableBodyRow.svelte (1)
33-38: LGTM: Improved dark mode support for striped tablesThe addition of dark mode variants (
dark:odd:anddark:even:) for all color schemes improves the component's dark mode support.src/routes/landing/DesignFigma.svelte (1)
31-31: LGTM: Improved dark mode image handlingThe change from
hiddentoblockfor the light mode image container improves the dark/light mode image switching implementation.src/lib/skeleton/ListPlaceholder.svelte (1)
8-8:Details
❓ Verification inconclusive
LGTM! Styling updates align with Tailwind upgrade.
The changes from
roundedtorounded-smandshadowtoshadow-smare consistent with the PR's objective of upgrading to Tailwind 4.0.Also applies to: 54-54
🏁 Script executed:
#!/bin/bash # Verify consistent usage of rounded-sm and shadow-sm across components rg -l "rounded\s" --type-add 'svelte:*.svelte' -tsvelte rg -l "shadow\s" --type-add 'svelte:*.svelte' -tsvelteLength of output: 706
LGTM for ListPlaceholder.svelte! The update correctly replaces
roundedwithrounded-smandshadowwithshadow-smin thedivClassdefault, aligning with the Tailwind 4.0 upgrade for this component.However, a repository-wide search shows that other components (e.g.,
src/lib/avatar/Avatar.svelte,src/lib/alert/Alert.svelte,src/lib/badge/Badge.svelte,src/lib/cards/Card.svelte, and several others) still use the legacyroundedandshadowclasses. If the goal of this PR is to standardize these Tailwind class updates across the board, please verify whether additional updates are intended for those components or if they will be handled separately.src/lib/accordion/Accordion.svelte (1)
32-32: LGTM! Improved dark mode hover effect ordering.The change from
hover:dark:bg-gray-800todark:hover:bg-gray-800follows Tailwind best practices for dark mode styling.Also applies to: 61-61
src/lib/skeleton/CardPlaceholder.svelte (1)
20-20: LGTM! Consistent styling updates.The changes to both the outer container and inner div maintain consistency with the Tailwind upgrade:
- Outer container:
rounded→rounded-sm,shadow→shadow-sm- Inner div:
rounded→rounded-smAlso applies to: 26-26, 51-51
src/routes/utils/CompoCard.svelte (1)
13-13: LGTM! Updated to Tailwind 4.0's important modifier syntax.The change from
!max-w-nonetomax-w-none!aligns with Tailwind 4.0's new syntax for important modifiers.src/lib/avatar/Avatar.svelte (1)
21-21:Details
❓ Verification inconclusive
Verify the visual impact of changing
roundedtorounded-sm.The change from
roundedtorounded-smwill result in a smaller border radius. Please ensure this change aligns with the design system's requirements.Also applies to: 40-40, 46-46, 50-50
🌐 Web query:
What is the difference between Tailwind CSS's `rounded` and `rounded-sm` classes in version 4.0?💡 Result:
In Tailwind CSS 4.0, there's been a renaming of border-radius utility classes as part of syntax updates. Here's the key difference:
roundedvsrounded-smin v4.0:
- The original
roundedclass (equivalent to 4px border-radius) has been renamed torounded-sm- The original
rounded-smclass (equivalent to 2px border-radius) has been renamed torounded-xsThis change was made to introduce clearer naming conventions where:
xs= extra small (2px)sm= small (4px)- New default
roundedclass now represents medium (6px) instead of small[3][7]Visual comparison table:
Class Name (v3) Border Radius Class Name (v4) rounded-sm 2px rounded-xs rounded 4px rounded-sm rounded-md 6px rounded These changes require updating existing implementations when migrating from v3 to v4[3][8]. The update aims to provide better consistency with other utility scales like padding and margin[10].
Citations:
- 1: https://tailkits.com/blog/tailwind-css-rounded-classes-guide/
- 2: https://peerlist.io/blog/engineering/whats-new-with-tailwind-css-v4
- 3: https://www.penguinui.com/blog/penguin-ui-tailwind-css-v4-update
- 4: https://www.youtube.com/watch?v=7IK9j9-H0vQ
- 5: https://daily.dev/blog/tailwind-css-40-everything-you-need-to-know-in-one-place
- 6: https://windframe.dev/tailwind/classes/tailwind-border-radius
- 7: https://www.tailwindtap.com/blog/tailwind-css-border-radius-guide
- 8: tailwindlabs/tailwindcss#8441
- 9: https://www.youtube.com/watch?v=X7ei0eqiWf0
- 10: https://tailwindcss.com/docs/border-radius
Verify the updated avatar border radius rendering
The updated prop definition:
export let rounded: $$Props['rounded-sm'] = false;reflects Tailwind CSS 4.0’s renaming where the new
rounded-smnow applies a 4px border radius (previously from the originalroundedclass). Please double-check that the avatar's appearance on lines 40, 46, and 50 is consistent with the desired design system, as the new defaultroundednow represents a 6px radius. Confirm that this change effectively meets the intended visual specifications.src/lib/forms/CheckboxButton.svelte (1)
27-27:Details
✅ Verification successful
Verify the visual impact of changing
shadowtoshadow-sm.The change from
shadowtoshadow-smwill result in a smaller shadow effect. Please ensure this change aligns with the design system's requirements.Also applies to: 99-99
🌐 Web query:
What is the difference between Tailwind CSS's `shadow` and `shadow-sm` classes in version 4.0?💡 Result:
In Tailwind CSS v4.0, the
shadowandshadow-smclasses have undergone significant changes as part of a broader renaming strategy for consistency across utility scales:Key Differences
Class (v4) Equivalent (v3) Purpose Example CSS Output shadow-smFormerly shadowApplies a medium base shadow box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1)[1][4]shadow-xsFormerly shadow-smApplies a smaller shadow than smNot explicitly shown but follows new scale[1][9] Version 4 Changes
- Renamed scale:
- Added
xstier at bottom of scale- Shifted existing names upward (
sm→xs, originalmd→ newsm)- Visual impact:
- The new
shadow-sm(old default shadow) creates more pronounced shadows than previous versions- New sizing aligns with other utilities like blur/radius scales (
blur-xs,rounded-xs)[1][9]Migration Example
<!-- v3 --> <div class="shadow"></div> <!-- v4 equivalent --> <div class="shadow-sm"></div>This change reflects Tailwind's effort to standardize utility naming across different property types while maintaining backward compatibility through automated upgrade tools[1][4]. Designers should test shadows after migration as visual weight might differ slightly despite equivalent naming positions[9].
Citations:
- 1: https://tailwindcss.com/docs/upgrade-guide
- 2: https://folge.me/tools/tailwind-shadow-generator
- 3: https://www.youtube.com/watch?v=7IK9j9-H0vQ
- 4: https://dev.to/kasenda/whats-new-and-migration-guide-tailwind-css-v40-3kag
- 5: https://www.epicweb.dev/tips/adding-a-shadow-to-an-svg-icon-with-tailwind-css
- 6: https://dev.to/best_codes/exciting-updates-in-tailwind-version-4-40i0
- 7: https://v3.tailwindcss.com/docs/box-shadow
- 8: zauberzeug/nicegui#1685
- 9: https://tailwindcss.com/blog/tailwindcss-v4
- 10: https://blogs.purecode.ai/blogs/tailwind-shadow
Ensure updated shadow styling aligns with design expectations
The change in
CheckboxButton.svelte(line 27, updating from$$Props['shadow']to$$Props['shadow-sm']) now reflects Tailwind CSS v4's revised naming convention. In v4, the newshadow-sm:
- Serves as the default medium shadow—matching what was previously provided by
shadowin earlier versions.- Is not necessarily a “smaller” shadow effect; if a truly smaller effect is desired, consider using
shadow-xs.Please verify on your end that the rendered shadow effect meets the design system's requirements and that the corresponding updates in the prop documentation (line 99) are accurate.
src/routes/utils/Newsletter.svelte (1)
30-30: LGTM! Class order updated for Tailwind 4.0.The modification from
sm:!w-96tosm:w-96!aligns with Tailwind 4.0's syntax for important modifiers.src/lib/darkmode/DarkMode.svelte (1)
11-11:Details
❓ Verification inconclusive
Consistent focus outline change applied.
The focus outline change matches other components, maintaining consistency across the UI.
Since this is a critical UI control for dark mode toggle, ensure the button remains accessible with keyboard navigation:
Also applies to: 67-67
🏁 Script executed:
#!/bin/bash # Search for any existing accessibility tests for the DarkMode component rg -l "accessibility|a11y" "test/DarkMode"Length of output: 96
Dark Mode Toggle UI – Consistent Focus Outline Applied, Manual Accessibility Check Needed
The focus outline changes at lines 11 and 67 in
src/lib/darkmode/DarkMode.svelteare consistent with adjustments in other components, ensuring a uniform UI appearance. However, our automated search for accessibility tests (using the providedrgcommand) did not find any tests for the DarkMode component. Since this toggle is a critical UI control, please manually verify that keyboard navigation and other accessibility aspects function as expected. Additionally, consider implementing automated tests for accessibility to help maintain high standards across the project.src/lib/forms/Select.svelte (1)
23-23:Details
❓ Verification inconclusive
Style updates aligned with Tailwind 4.0.
The changes include:
- Updated focus outline class for consistency
- Modified important modifier syntax from
!px-0topx-0!Both changes follow Tailwind 4.0 conventions while maintaining the same functionality.
Let's verify the Select component's accessibility with the new focus styles:
Also applies to: 33-33, 59-59
🏁 Script executed:
#!/bin/bash # Search for accessibility tests for the Select component rg -l "accessibility|a11y" "test/Select"Length of output: 92
Tailwind 4.0 Syntax Update – Manual Accessibility Verification Required
The changes in
src/lib/forms/Select.svelte(Lines 23, 33, 59) correctly update the focus outline style and shift the important modifier syntax from!px-0topx-0!per Tailwind 4.0 conventions. This should preserve the component’s visual and functional integrity. However, the automated search for accessibility tests (targeting atest/Selectdirectory) returned no results—please verify manually that the updated focus styles meet accessibility requirements.
- Location:
src/lib/forms/Select.svelte(Lines 23, 33, 59)- Changes:
- Updated focus outline class for consistency.
- Modified from
!px-0topx-0!to adhere to Tailwind 4.0.- Next Steps: Manually verify the component’s accessibility since automated tests were not found.
src/lib/indicators/Indicator.svelte (1)
16-16:Details
❓ Verification inconclusive
Verify the visual impact of the rounded style change.
The change from
roundedtorounded-smaligns with the Tailwind 4.0 upgrade. However, this change might affect the visual appearance of existing indicators.Also applies to: 81-81, 91-91
🌐 Web query:
What are the differences between Tailwind CSS rounded and rounded-sm classes in version 4.0?💡 Result:
In Tailwind CSS v4.0, there's a significant renaming of border radius classes due to updated naming conventions for clearer scaling:
Key Differences
Class (v4.0) Previous Equivalent Purpose rounded-smv3's roundedApplies default base rounding (now considered "small") rounded-xsv3's rounded-smNew extra-small rounding tier added This change reflects Tailwind's effort to:
- Establish a more intuitive size hierarchy (
xs,sm,md,lg, etc.)- Align naming with other utility scales like shadows and blurs[8]
- Provide finer control over border radius increments
Practical Implications
<!-- v3 Syntax --> <div class="rounded">...</div> <!-- Medium rounding --> <div class="rounded-sm">...</div> <!-- Small rounding --> <!-- v4 Syntax --> <div class="rounded-md">...</div> <!-- New medium equivalent --> <div class="rounded-sm">...</div> <!-- Previous 'rounded' class --> <div class="rounded-xs">...</div> <!-- Previous 'rounded-sm' -->Developers upgrading from v3 should:
- Replace
roundedwithrounded-sm- Change
rounded-smtorounded-xs- Use new
rounded-mdfor medium-sized rounding[8]The actual CSS output values have been adjusted accordingly though specific pixel measurements aren't shown in documentation snippets[1][8]. This change emphasizes Tailwind's move toward more explicit utility naming while maintaining backward compatibility through automatic upgrade tools[9].
Citations:
- 1: https://tailwindcss.com/docs/border-radius
- 2: https://tailscan.com/tailwind/borders/rounded-sm
- 3: https://www.youtube.com/watch?v=7IK9j9-H0vQ
- 4: https://tailkits.com/blog/tailwind-css-rounded-classes-guide/
- 5: https://www.tailwindtap.com/blog/tailwind-css-border-radius-guide
- 6: tailwindlabs/tailwindcss#2724
- 7: https://v3.tailwindcss.com/docs/border-radius
- 8: https://www.penguinui.com/blog/penguin-ui-tailwind-css-v4-update
- 9: https://tailwindcss.com/blog/tailwindcss-v4
- 10: https://windframe.dev/tailwind/classes/tailwind-border-radius
Action: Confirm visual integrity post Tailwind upgrade.
The changes — updating the property type on line 16 to use
$$Props['rounded-sm'], switching the class on line 81 torounded-sm, and updating the documentation on line 91 — are consistent with Tailwind CSS v4.0 conventions. Recall that in v4.0,rounded-smnow applies the default base rounding (previously provided byrounded), and the naming changes are intentional. However, this update may result in slightly different rounding effects on indicator elements. Please verify through visual regression or design review that the new rounded styling meets the intended UI design.
- Indicator.svelte Line 16: Changed export type to use
$$Props['rounded-sm']- Indicator.svelte Line 81: Updated the class string to
rounded-sm- Indicator.svelte Line 91: Documentation reflects the updated type
src/lib/sidebar/SidebarDropdownWrapper.svelte (1)
29-29:Details
❓ Verification inconclusive
Verify TransitionTypes definition for 'blur-sm'.
The transition type has been updated from 'blur' to 'blur-sm'. Ensure that this type is properly defined in the TransitionTypes interface.
🏁 Script executed:
#!/bin/bash # Check if TransitionTypes includes 'blur-sm' ast-grep --pattern 'type TransitionTypes = $$$"blur-sm"$$$'Length of output: 61
Please manually verify that "blur-sm" is included in the TransitionTypes definition.
The automated ast-grep command did not return any output. To be certain, please verify by checking the file(s) where the TransitionTypes are defined or by running a more comprehensive search (for example, with
rg "type TransitionTypes"andrg '"blur-sm"'). If you find that "blur-sm" is not yet defined, you will need to update the TransitionTypes interface accordingly.src/lib/toolbar/ToolbarButton.svelte (2)
46-47: LGTM! Standardizing border radius classes.The changes to use
rounded-xsandrounded-smalign with the broader effort to standardize styling across components in the Tailwind 4.0 upgrade.
53-53: LGTM! Updated focus outline class.The change from
focus:outline-nonetofocus:outline-hiddenaligns with the Tailwind 4.0 upgrade.src/lib/navbar/NavUl.svelte (2)
56-56: LGTM! Updated border radius class.The change to use
rounded-smaligns with the standardized styling in Tailwind 4.0.
61-61: LGTM! Improved hidden state handling.The change to use
class:hiddendirective improves reactivity by using Svelte's built-in class directive.src/lib/banner/Banner.svelte (2)
37-37: LGTM! Updated shadow class.The change to use
shadow-xsaligns with the standardized styling in Tailwind 4.0.
46-47: LGTM! Simplified flex-shrink class.The change from
flex-shrink-0toshrink-0aligns with Tailwind's simplified class naming convention.src/lib/dropdown/Dropdown.svelte (1)
49-50: LGTM! Updated prop types for shadow and rounded properties.The changes to use
shadow-smandrounded-smtypes align with the standardized styling in Tailwind 4.0.src/lib/timeline/ActivityItem.svelte (1)
29-29: LGTM: Shadow refinement aligns with Tailwind 4.0 upgrade.The change from
shadow-smtoshadow-xsis consistent with the broader refinement of shadow effects across components in this upgrade.Also applies to: 82-82
src/lib/drawer/Drawer.svelte (1)
36-36: LGTM: Modern Tailwind syntax adoption.The changes improve code clarity by:
- Using the modern opacity syntax (
bg-black/75instead ofbg-opacity-75)- Adopting the more specific blur transition type (
blur-sm)Also applies to: 47-48, 102-102
src/lib/types.ts (1)
67-67:Details
❓ Verification inconclusive
Verify transition type updates across components.
The change from
'blur'to'blur-sm'in TransitionTypes requires verification of all components using blur transitions.
🏁 Script executed:
#!/bin/bash # Search for any remaining 'blur' transition usages that need updating rg "transition.*blur[^-]" --type svelteLength of output: 72
Below is a revised review comment that asks for manual re‑verification using a revised search command:
Action Required: Verify Transition Updates in Components
The update to TransitionTypes now uses
'blur-sm'for the non‑directional blur, so all components referencing the old blur transition should be updated accordingly. The previous search using the svelte file type failed (unrecognized file type), so please run the following command manually to verify there are no outdated usages of a plain "blur" transition:#!/bin/bash # Search for any outdated blur transitions in .svelte files using a glob pattern rg "transition.*blur[^-]" --glob "*.svelte"If this search produces no results, it confirms that all relevant components have been updated.
src/lib/forms/FloatingLabelInput.svelte (1)
66-68: LGTM: Improved focus handling and dark mode accessibility.Changes enhance the component by:
- Using modern focus outline handling (
focus:outline-hidden)- Adding dark mode focus color for better visibility (
dark:peer-focus:text-primary-500)Also applies to: 84-84
src/lib/buttons/GradientButton.svelte (1)
18-32:Details
❓ Verification inconclusive
Verify new gradient class naming convention.
The change from
bg-gradient-to-*tobg-linear-to-*appears to be part of the Tailwind 4.0 upgrade. Let's verify this new naming convention.
🌐 Web query:
Does Tailwind CSS 4.0 use bg-linear-to-* instead of bg-gradient-to-* for gradients?💡 Result:
Tailwind CSS 4.0 introduces significant changes to gradient utilities while maintaining backward compatibility. The new version uses bg-linear-to-* syntax alongside enhanced features, but continues supporting bg-gradient-to-* for compatibility[2][5][9].
Key changes in v4.0 gradients:
New syntax options
bg-linear-to-{direction}replacesbg-gradient-to-{direction}as the primary syntax- Legacy
bg-gradient-to-*still works but new projects are encouraged to usebg-linearvariants[2][9]Color space control
<!-- Specify color interpolation method --> <div class="bg-linear-to-r/srgb from-indigo-500 to-teal-400"></div> <div class="bg-linear-to-r/oklch from-indigo-500 to-teal-400"></div>Added
/srgband/oklchmodifiers for color space control[2]Expanded gradient types
- New support for conic gradients:
<div class="bg-conic/[in_hsl_longer_hue] from-red-600 to-red-600"></div>- Enhanced radial gradients:
<div class="bg-radial-[at_25%_25%] from-white to-zinc-900"></div>[2][5]
Migration considerations:
- Existing
bg-gradient-to-{direction}classes still function- New features like color space control require
bg-linearsyntax- Documentation recommends using
bg-linearfor new projects[9]The change reflects Tailwind's shift toward more explicit naming conventions and better color management through OKLCH color spaces[2][5]. Developers can choose between legacy and new syntax based on project requirements[9].
Citations:
- 1: https://blog.logrocket.com/guide-adding-gradients-tailwind-css/
- 2: https://peerlist.io/blog/engineering/whats-new-with-tailwind-css-v4
- 3: https://pagedone.io/docs/gradient
- 4: tailwindlabs/tailwindcss#10146
- 5: https://tailwindcss.com/blog/tailwindcss-v4
- 6: tailwindlabs/tailwindcss#15910
- 7: https://www.youtube.com/watch?v=ud913ekwAOQ
- 8: tailwindlabs/tailwindcss#16037
- 9: https://tailwindcss.com/docs/background-image
Verified: Gradient Class Naming and Caution on !important Usage
The update replacing
bg-gradient-to-*withbg-linear-to-*aligns with Tailwind CSS 4.0’s new gradient utility syntax. As confirmed by the query results, Tailwind v4.0 now promotes thebg-linear-to-*convention while still retaining support for legacy classes.Additionally, the extensive use of
!importantmodifiers ingradientOutlineClassmight create specificity challenges. Please double-check this implementation to ensure these modifiers aren’t inadvertently causing style conflicts.
- Verify that the new
bg-linear-to-*classes meet your project’s design requirements.- Reassess the need for
!importantingradientOutlineClassto avoid potential maintenance issues.src/lib/table/Table.svelte (1)
32-32: Verify shadow implementation consistency.While the property type has been changed to
shadow-sm, the template still usesshadow-md. This might be inconsistent with the type definition.Consider updating the template to match the type:
-<div class={twJoin(divClass, shadow && 'shadow-md sm:rounded-lg')}> +<div class={twJoin(divClass, shadow && 'shadow-sm sm:rounded-lg')}>Also applies to: 78-78
src/routes/landing/CTA.svelte (1)
42-42: LGTM! Tailwind v4.0 syntax update.The change updates the important modifier syntax from
!text-gray-400totext-gray-400!to align with Tailwind CSS v4.0's new syntax for important modifiers.src/lib/accordion/AccordionItem.svelte (1)
55-55:Details
✅ Verification successful
Verify transition type update across codebase.
The transition type has been updated from
'blur'to'blur-sm'to use Tailwind's new granular blur utilities.Run the following script to verify consistent transition type usage:
🏁 Script executed:
#!/bin/bash # Description: Check for any remaining 'blur' transition types that need to be updated. # Search for transition type declarations rg -A 5 "transitionType.*=.*'blur'" # Search for blur imports and usage rg -A 5 "import.*blur.*from.*svelte/transition"Length of output: 2511
Transition type update verified – no further changes needed.
I verified that the updated transition type
'blur-sm'is used in the transition declarations (e.g. insrc/lib/accordion/AccordionItem.svelte), and no assignments still reference the old string'blur'. The remaining references toblurappear only in the import statements fromsvelte/transition, which are correct since they import the transition functions and don’t require updating.src/lib/buttons/Button.svelte (2)
37-37: LGTM! Updated shadow property type.The shadow property type has been updated to use Tailwind's more specific
shadow-smutility.
122-122: LGTM! Updated focus outline class.The focus outline class has been updated from
focus-within:outline-nonetofocus-within:outline-hiddento align with Tailwind v4.0's new outline utilities.src/routes/utils/ExampleWrapper.svelte (3)
10-10: LGTM! Updated gradient class to linear.The background gradient class has been updated from
bg-gradient-to-rtobg-linear-to-rto align with Tailwind v4.0's new linear gradient utilities.
178-178: LGTM! Updated important modifier position.The important modifier has been moved from
dark:!bg-gray-900todark:bg-gray-900!to align with Tailwind v4.0's new syntax for important modifiers.
246-246: LGTM! Updated important modifier positions.The important modifiers have been moved to the end of each class (
-mt-2! rounded-none!) to align with Tailwind v4.0's new syntax for important modifiers.src/routes/component-data/Drawer.json (1)
16-16: Update Tailwind 4.0 Opacity SyntaxThe default value for the
bgOpacity?property has been updated from the Tailwind v3 style ('bg-opacity-75') to the new v4 style ('bg-black/75'). This change is aligned with the updated Tailwind CSS syntax and ensures consistency with other components.src/app.css (6)
1-2: Scope CSS Imports to Base LayerThe import statements now include the
layer(base)directive, ensuring thatdocs.cssandflowbite.cssare correctly scoped as base styles in the Tailwind setup. This is appropriate for Tailwind CSS 4.0.
5-7: Integrate Tailwind CSS and Flowbite PluginThe new directives, including the
@import 'tailwindcss';and@plugin 'flowbite/plugin';, correctly configure the project to leverage Tailwind CSS 4.0 features along with the Flowbite plugin enhancements.
9-9: Define Custom Dark VariantThe custom variant defined with
@custom-variant dark (&:where(.dark, .dark *));effectively targets dark mode elements, helping to manage dark mode styling in a modern and scalable way.
11-24: Consistent Theming with CSS VariablesThe
@themeblock establishes a set of CSS variables for colors and z-index, which promotes consistent styling across the application. This structured approach is beneficial for future theme modifications.
34-42: Maintain Border Color CompatibilityThe added
@layer baseblock for border colors ensures that elements default to usingcurrentColorwhen no explicit border color is set. This compatibility style helps maintain visual consistency despite Tailwind CSS v4.0 changes.
77-79: Switch to New Gradient Utility ClassIn the
#mainContent > preselector, the background gradient class has been updated frombg-gradient-to-rtobg-linear-to-r. This update conforms to the new Tailwind CSS 4.0 conventions and reflects the intended styling revision.src/routes/docs/pages/customization.md (1)
39-40: Update Important Modifier Syntax in ExamplesThe example now demonstrates the important modifier with the exclamation mark at the end of the class names (e.g.,
bg-blue-500!andbg-green-500!). This change is consistent with the revised Tailwind CSS 4.0 approach and ensures that the documentation matches practical implementation.src/routes/docs/typography/hr.md (1)
50-50: Refine Border Radius for HR ComponentThe
<Hr>component example has been updated to userounded-sminstead ofrounded(i.e.,classHr="w-48 h-1 mx-auto my-4 rounded-sm md:my-10"). This provides a subtler rounding effect that aligns with the new design guidelines.src/routes/docs/components/button-group.md (4)
35-35: Consistent Important Ring ModifierThe
<ButtonGroup>component now applies the important modifier to the ring class as*:ring-primary-700!. This adjustment ensures that the ring style is enforced with the correct specificity using the updated Tailwind CSS notation.
92-92: Update ButtonGroup Usage for Link VariantsIn the section demonstrating button groups used as links, the modified class (
*:ring-primary-700!) reflects the same styling rules. This update provides uniformity across different usages of the component.
109-109: Uniform Application of Ring Modifier with IconsFor button groups that include icons, updating to
*:ring-primary-700!ensures that the intended ring styling is applied consistently, regardless of content variations within the group.
179-179: Ensure Event Section ConsistencyThe event handling example now uses the updated ring modifier (
*:ring-primary-700!) in the<ButtonGroup>, maintaining visual consistency even in interactive components.src/routes/docs/typography/image.md (1)
141-141: Confirm Updated Blur Utility ClassThe image now applies
blur-xsrather than the previousblur-sm(or similar) class. Please verify thatblur-xsproduces the intended subtle blur effect under Tailwind 4.0 guidelines.src/routes/docs/components/avatar.md (1)
96-101: Update Avatar’s Rounded Property torounded-smThe avatar examples in the tooltip section have been updated to use the
rounded-smprop instead of the genericrounded. This change aligns with the new styling conventions. Ensure that all avatar instances across the project are updated consistently.src/routes/docs/components/carousel.md (2)
164-166: Update Caption Container’s Rounded ClassThe caption container now uses
rounded-smto round its corners. Confirm that this subtle rounding meets the design requirements and is consistent with other component updates.
201-205: Confirm Carousel Image Class Change torounded-xsThe Carousel’s
imgClassnow includesrounded-xsfor its images. Please verify that this new class meets the visual design specifications and that the change is consistently applied across carousel components.src/routes/docs/components/badge.md (1)
90-90: Clarify Pills Badge Rounded PropThe documentation now instructs using the
rounded-smprop for pill-styled badges. This update clearly communicates the new styling standard. Ensure that all examples and implementations use this updated prop consistently.src/routes/docs/components/banner.md (3)
49-49: Updated Anchor Decoration Classes
The anchor tag’s utility classes have been updated from using higher numeric decoration values (e.g.decoration-600/decoration-500) to a numeric scale (decoration-2/decoration-1). Please verify that these changes yield the intended underline thickness and offset effects in both light and dark modes.
118-118: Simplified Label Shrink Class
The label for the email input field now usesshrink-0instead offlex-shrink-0. This update aligns with Tailwind CSS 4.0’s utility class guidelines. Confirm that the visual layout remains consistent.
120-120: Revised Button Focus Outline
The submit button now usesfocus:outline-hiddenin place of the previous focus outline utility. Ensure that this change provides sufficient visual feedback for focus states across browsers and accessibility scenarios.src/routes/docs/typography/blockquote.md (2)
91-91: Updated Figure Max-Width Utility
The<figure>element’s class has been changed from a fixed width (e.g.max-w-screen-md) to a custom property-based width (max-w-(--breakpoint-md)). Please verify that the CSS custom property--breakpoint-mdis properly defined and responsive as expected.
113-113: Consistent Use of Custom Max-Width in User Review
Similarly, the<figure>element in the user review example now usesmax-w-(--breakpoint-md). Confirm that this change maintains consistent responsive behavior throughout the documentation.src/routes/docs/components/indicators.md (3)
115-117: Consistent 'rounded-sm' Usage for Badge Indicator
The Badge component now uses therounded-smutility class, aligning with the newer Tailwind CSS guidelines for a subtler border radius. This update appears in the “Available” indicator; please ensure it visually harmonizes with other components.
129-132: Updated Rounded Styling on Red Badge Indicator
The red Badge now also usesrounded-smto ensure consistency. Verify that the size and curvature meet the design standards and that no unintended layout shifts occur.
228-230: Verify Forced Style Override on Nested Indicator
Within the stepper indicator, the nested Indicator now applies a class with an exclamation mark (dark:bg-gray-300!), using Tailwind’s important modifier. Please ensure this override is intentional and does not conflict with global dark mode styles.src/routes/docs/forms/select.md (2)
113-117: Updated Dropdown Button Styles
The button triggering the states dropdown has been updated with classes such asfocus:outline-hiddenand retains a concise set of Tailwind utilities. Confirm that the focus state and visual appearance meet accessibility and design requirements.
136-136: Reordered Important Modifier in Select Component
TheSelectcomponent’s class has been changed from!rounded-s-nonetorounded-s-none!. This subtle reordering affects the application of the important modifier in Tailwind CSS 4.0. Please verify that it behaves as intended.src/routes/docs/components/timeline.md (1)
146-146: Adjusted Badge Rounding in Activity Item Title
Within the Activity Log’s first timeline entry, the<span>element now usesrounded-sminstead ofrounded. This update should provide a more refined border radius. Confirm that it visually aligns with the new design language across the timeline component.package.json (22)
3-3: Verify Package Version Update
The package version has been updated to"0.48.0". Ensure that any tooling, integrations, or documentation referencing the old version are updated accordingly.
42-42: Update @docsearch/css Dependency
The version for@docsearch/cssis now^3.9.0instead of the older version. Confirm that this update does not introduce any breaking changes in components that rely on it.
43-43: Update @docsearch/js Dependency
The version for@docsearch/jsis updated to^3.9.0. This should help maintain consistency with the CSS counterpart.
44-44: Update @playwright/test Version
The Playwright version is explicitly set to"1.49.0". Verify that the change correctly addresses any previous version issues and that your tests run reliably with this version.
45-45: Update @sveltejs/adapter-vercel Dependency
The@sveltejs/adapter-verceldependency has been upgraded to^5.6.2. Make sure that deployment on Vercel is tested thoroughly with this update.
46-46: Update @sveltejs/kit Dependency
The version for@sveltejs/kitis now^2.17.2. Double-check for any breaking changes in this major dependency that might affect routing or build behavior.
50-50: Update @tailwindcss/postcss Dependency
The dependency has been updated to^4.0.7, which aligns with the Tailwind CSS 4.0 upgrade. Ensure that the PostCSS configuration is in sync with this change.
54-54: Update eslint Dependency
eslintis now at version^9.20.1. Confirm that your linting rules and configuration still comply with your code style after this update.
58-58: Update globals Dependency
The version forglobalshas been bumped to^15.15.0. Check if any new global variables need to be accounted for in your codebase.
61-61: Update postcss Dependency
The update to^8.5.3should work well with the new Tailwind CSS setup. Verify that your PostCSS processing behaves as expected.
62-62: Update prettier Dependency
prettieris updated now to^3.5.1. It’s a good idea to run a formatting check to ensure that the auto-formatting remains consistent.
63-63: Update prettier-plugin-svelte
Theprettier-plugin-svelteversion is updated to^3.3.3. This should enhance Svelte formatting support. Verify that there are no regressions in code formatting.
67-67: Update svelte-check Dependency
Upgrading to^4.1.4should improve type checking in Svelte components. Ensure you run type tests after this update.
71-71: Update svelte2tsx Dependency
The version has been updated to^0.7.34. Confirm that the Svelte-to-TypeScript conversion is operating correctly without errors.
72-72: Check Tailwind-Merge Version Consistency (devDependencies)
Note that"tailwind-merge": "^1.13.1"appears in devDependencies. Since in the dependencies section it is updated to"^3.0.1", please verify if this discrepancy is intentional or if alignment is needed.
73-73: Update Tailwindcss in devDependencies
Tailwind CSS has been upgraded to^4.0.7to match the major upgrade objective. Ensure that the Tailwind configuration files are adjusted accordingly.
75-75: Update TypeScript Dependency
The TypeScript version is now^5.7.3. This minor bump should be compatible, but a quick check on your TS-based tooling won’t hurt.
77-77: Update Vite Dependency
Vite is updated to^5.4.14. It is advisable to run a full build and preview to ensure that the development server functions without issues.
78-78: Update Vitest Dependency
The updated version ofvitestis now^2.1.9. Ensure that your unit tests execute normally and that any test runners or related scripts are updated if necessary.
127-127: Update @floating-ui/dom Dependency in Dependencies
The version of@floating-ui/domis bumped to^1.6.13. Test any UI components that use floating UI components for proper behavior.
129-129: Update flowbite Dependency
flowbitehas been updated to^3.1.2. Validate that the UI components integrating Flowbite are rendering and functioning as expected with this new version.
130-130: Update tailwind-merge Dependency in Dependencies
The dependency is now set to^3.0.1in the dependencies section. As noted in the devDependencies, please confirm whether the version difference is intentional or if both should be synchronized.
| // styles | ||
| const styledActiveClasses = { | ||
| full: 'p-4 w-full group-first:rounded-s-lg group-last:rounded-e-lg text-gray-900 bg-gray-100 focus:ring-4 focus:ring-primary-300 focus:outline-none dark:bg-gray-700 dark:text-white', | ||
| full: 'p-4 w-full group-first:rounded-s-lg group-last:rounded-e-lg text-gray-900 bg-gray-100 focus:ring-4 focus:ring-primary-300 focus:outline-hidden dark:bg-gray-700 dark:text-white', |
There was a problem hiding this comment.
💡 Verification agent
🛠️ Refactor suggestion
🧩 Analysis chain
Verify the validity and accessibility of the focus outline change.
The change from focus:outline-none to focus:outline-hidden needs verification:
- Confirm if this is a valid class in Tailwind CSS v4.0
- Consider the accessibility implications of hiding focus outlines
Let's verify if this is a valid Tailwind CSS class:
Consider maintaining visible focus indicators for keyboard navigation, which is crucial for accessibility. If the outline needs to be customized, consider using focus:ring utilities (which are already present in the code) rather than hiding the outline completely.
If focus:outline-hidden is not a valid Tailwind class, revert to using focus:outline-none or implement a more accessible alternative:
- full: 'p-4 w-full group-first:rounded-s-lg group-last:rounded-e-lg text-gray-900 bg-gray-100 focus:ring-4 focus:ring-primary-300 focus:outline-hidden dark:bg-gray-700 dark:text-white',
+ full: 'p-4 w-full group-first:rounded-s-lg group-last:rounded-e-lg text-gray-900 bg-gray-100 focus:ring-4 focus:ring-primary-300 focus:outline-none dark:bg-gray-700 dark:text-white',- full: 'p-4 w-full group-first:rounded-s-lg group-last:rounded-e-lg text-gray-500 dark:text-gray-400 bg-white hover:text-gray-700 hover:bg-gray-50 focus:ring-4 focus:ring-primary-300 focus:outline-hidden dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700',
+ full: 'p-4 w-full group-first:rounded-s-lg group-last:rounded-e-lg text-gray-500 dark:text-gray-400 bg-white hover:text-gray-700 hover:bg-gray-50 focus:ring-4 focus:ring-primary-300 focus:outline-none dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700',Also applies to: 41-41
🌐 Web query:
Does Tailwind CSS v4.0 support the focus:outline-hidden class? What's the recommended way to handle focus outlines in Tailwind CSS?
💡 Result:
Tailwind CSS v4.0 does not include a dedicated focus:outline-hidden class[1][5]. However, developers can achieve similar functionality using existing utilities while maintaining accessibility best practices.
Recommended Focus Outline Handling
-
For basic outline removal:
Usefocus:outline-noneto disable default browser outlines[1][5], but always pair this with alternative visual indicators:<input class="focus:outline-none focus:ring-2 focus:ring-blue-500 ...">
-
For forced colors mode compatibility:
Useoutline-hidden(available in v4) instead ofoutline-nonewhen preserving forced colors mode visibility:<button class="outline-hidden focus:ring-4 focus:ring-green-300 ...">
-
Modern accessibility patterns:
Combine withfocus-visiblevariant for keyboard-specific styling:<a href="#" class="focus-visible:outline-dashed focus-visible:outline-2 ...">
Key Implementation Table
| Requirement | Utility | Accessibility Pairing |
|---|---|---|
| Remove default outline | focus:outline-none |
focus:ring, focus:border[5][9] |
| Preserve forced colors | outline-hidden |
Custom hover/focus states[1][10] |
| Keyboard-only focus | focus-visible: variant |
Color contrast adjustments[7][8] |
The v4 documentation emphasizes using CSS variables for consistent focus styling across components[4][10]:
@theme {
--focus-ring-width: 3px;
--focus-ring-color: oklch(47% 0.25 274);
}Developers should prioritize the ring utilities over outline manipulation for modern accessibility requirements[10], while reserving outline-* classes for specific design cases requiring dashed/dotted borders[2][5].
Citations:
- 1: https://tailwindcss.com/docs/outline-style
- 2: https://kombai.com/tailwind/outline-style/
- 3: https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible
- 4: https://tailwindcss.com/blog/tailwindcss-v4
- 5: https://v3.tailwindcss.com/docs/outline-style
- 6: https://tailwindcss.com/docs/upgrade-guide
- 7: https://tailwindcss.com/docs/hover-focus-and-other-states
- 8: Applying Global Focus Styles in Tailwind CSS tailwindlabs/tailwindcss#13338
- 9: outline-none doesn't work on button with focus in chrome tailwindlabs/tailwindcss#1231
- 10: https://tailwindcss.com/blog/tailwindcss-v4-alpha
Action Required: Revert Unsupported Focus Class Change
After verifying with the latest Tailwind CSS v4.0 documentation, the focus:outline-hidden class is not supported. The recommended approach for removing default outlines is to use focus:outline-none along with complementary utilities (such as focus rings) to maintain keyboard navigability and accessibility.
Please update the affected instances in both the modified segments (lines 34 and 41) in src/lib/tabs/Tabs.svelte by reverting:
- full: 'p-4 w-full group-first:rounded-s-lg group-last:rounded-e-lg text-gray-900 bg-gray-100 focus:ring-4 focus:ring-primary-300 focus:outline-hidden dark:bg-gray-700 dark:text-white',
+ full: 'p-4 w-full group-first:rounded-s-lg group-last:rounded-e-lg text-gray-900 bg-gray-100 focus:ring-4 focus:ring-primary-300 focus:outline-none dark:bg-gray-700 dark:text-white',And similarly for the other instance:
- full: 'p-4 w-full group-first:rounded-s-lg group-last:rounded-e-lg text-gray-500 dark:text-gray-400 bg-white hover:text-gray-700 hover:bg-gray-50 focus:ring-4 focus:ring-primary-300 focus:outline-hidden dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700',
+ full: 'p-4 w-full group-first:rounded-s-lg group-last:rounded-e-lg text-gray-500 dark:text-gray-400 bg-white hover:text-gray-700 hover:bg-gray-50 focus:ring-4 focus:ring-primary-300 focus:outline-none dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700',Maintaining visible focus indications is crucial for accessibility, so please ensure these changes align with our accessibility best practices.
| </script> | ||
|
|
||
| <button on:click type="button" class="flex items-center p-2 me-2 text-xs font-medium text-gray-700 bg-white border border-gray-200 rounded-lg toggle-dark-state-example hover:bg-gray-100 hover:text-primary-700 dark:hover:text-primary-600 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700"> | ||
| <button on:click type="button" class="flex items-center p-2 me-2 text-xs font-medium text-gray-700 bg-white border border-gray-200 rounded-lg toggle-dark-state-example hover:bg-gray-100 hover:text-primary-700 dark:hover:text-primary-600 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-hidden dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700"> |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify focus outline class and accessibility impact
The change from focus:outline-none to focus:outline-hidden needs verification:
- Confirm if
focus:outline-hiddenis a valid class in Tailwind 4.0 - Ensure this change maintains proper focus visibility for accessibility
🌐 Web query:
Is focus:outline-hidden a valid class in Tailwind CSS v4.0? What's the recommended way to handle focus outlines for accessibility?
💡 Result:
In Tailwind CSS v4.0, focus:outline-hidden is not a valid utility class. The current documentation shows outline-hidden exists as a standalone utility (not a variant) that applies transparent outlines[1][4], but this isn't available as a focus variant in v4.x[7][10].
For accessible focus handling in Tailwind CSS v4.x:
Recommended approach
<button class="focus:outline-none focus:ring-2 focus:ring-blue-500">
Accessible button
</button>
Key considerations:
-
Never remove focus indicators without replacement
The default browser outline is crucial for keyboard navigation accessibility[5][6]. -
Preferred solutions:
- Ring utilities (best practice):
<input class="focus:ring-2 focus:ring-blue-500">
- Custom outline styling:
<button class="focus:outline-dashed focus:outline-2 focus:outline-blue-500">
- Ring utilities (best practice):
-
For forced color modes (Windows High Contrast):
Use transparent outlines instead ofnone:<input class="focus:outline-[2px_solid_transparent]">
Configuration options
Add global focus styles in your base layer:
@layer base {
button:focus {
@apply outline-none ring-2 ring-blue-500;
}
}Accessibility compliance:
| Technique | WCAG Success | Browser Support |
|---|---|---|
ring utilities |
AAA | All modern |
| Custom outlines | AA | IE11+ |
| Transparent outlines | AA | Forced colors only |
The core principle remains: always provide visible focus states when modifying default browser behavior[3][5][6]. Use Tailwind's ring utilities as they're specifically designed for accessible focus indicators[5][7].
Citations:
- 1: https://v3.tailwindcss.com/docs/outline-style
- 2: https://v1.tailwindcss.com/docs/outline
- 3: https://floatui.com/blog/tailwind-button-outline-primary-secondary-danger-warning-info-and-more
- 4: https://tailwindcss.com/docs/outline-style
- 5: Why is the default outline not removed? tailwindlabs/tailwindcss#2949
- 6: https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible
- 7: https://v3.tailwindcss.com/docs/v4-beta
- 8: https://codecourse.com/forum/109-override-tailwind-outline-for-inputs-and-buttons
- 9: outline-none doesn't work on button with focus in chrome tailwindlabs/tailwindcss#1231
- 10: [v4] :focus-visible no longer overrides default outline for some reason tailwindlabs/tailwindcss#15152
Action Needed: Replace the Invalid Focus Utility for Accessibility
The recent change from focus:outline-none to focus:outline-hidden in src/routes/utils/ExampleDarkMode.svelte is problematic because:
- Invalid Utility Class:
focus:outline-hiddenis not a valid Tailwind CSS v4.0 class. Tailwind’s documentation confirms that no focus variant exists foroutline-hidden. - Accessibility Impact: Removing default focus indicators without providing a proper replacement can negatively affect keyboard navigation and overall accessibility.
Recommended Fix:
- Revert to using
focus:outline-noneif you intend to remove the native browser outline. - Enhance Accessibility: Instead of merely removing the outline, add accessible focus styling. For example:
<button on:click type="button" class="flex items-center p-2 me-2 text-xs font-medium text-gray-700 bg-white border border-gray-200 rounded-lg toggle-dark-state-example hover:bg-gray-100 hover:text-primary-700 dark:hover:text-primary-600 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-gray-500 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700">
This approach uses Tailwind’s ring utilities to ensure that keyboard focus remains visible while aligning with best accessibility practices.
| }; | ||
|
|
||
| $: imgClass = twMerge('absolute block !w-full h-full object-cover', $$props.class); | ||
| $: imgClass = twMerge('absolute block w-full! h-full object-cover', $$props.class); |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify Tailwind 4.0 important modifier syntax.
The change in the position of the ! modifier from !w-full to w-full! might be related to Tailwind 4.0's syntax changes.
🌐 Web query:
What is the correct syntax for important modifiers in Tailwind CSS 4.0?
💡 Result:
Tailwind CSS 4.0 maintains the same ! prefix syntax for important modifiers as previous versions[3][10]. To apply !important to a specific utility class:
<div class="!font-medium">This text uses !important</div>Key implementation details:
- Global configuration: You can still enable
!importantfor all utilities via CSS configuration[3][4]:@theme { --important: true; }
- Dynamic overrides: Works seamlessly with new variants like
data-*attributes[4][7]:<div data-error class="text-red-500 data-error:!text-red-600">
- Arbitrary value support: Combine with parenthetical syntax for custom properties[7][9]:
<div class="!bg-(--custom-color)">
The JIT compiler automatically handles these cases without requiring additional configuration[3][7]. For component extraction, Tailwind 4.0 preserves !important declarations when using @apply directives[3][9].
Citations:
- 1: https://peerlist.io/blog/engineering/whats-new-with-tailwind-css-v4
- 2: https://daily.dev/blog/tailwind-css-40-everything-you-need-to-know-in-one-place
- 3: https://sebastiandedeyne.com/why-we-use-important-with-tailwind
- 4: https://tailwindcss.com/blog/tailwindcss-v4
- 5: https://www.youtube.com/watch?v=ud913ekwAOQ
- 6: https://alexvipond.dev/blog/configuring-tailwind-4-0
- 7: https://tailwindcss.com/docs/upgrade-guide
- 8: https://tailwindcss.com/docs/functions-and-directives
- 9: https://cixel.com.au/blog/tailwind-css-v4-functional-utilities
- 10: https://blogs.purecode.ai/blogs/tailwind-important
Tailwind Important Modifier Syntax Correction
The important modifier in Tailwind CSS 4.0 should use the prefix !, so the utility should be written as !w-full instead of w-full!. Please update line 33 in src/lib/carousel/Slide.svelte as follows:
$: imgClass = twMerge('absolute block !w-full h-full object-cover', $$props.class);| const context = getContext<SpeedCtxType>('speed-dial'); | ||
|
|
||
| export let btnDefaultClass: $$Props['defaultClass'] = 'w-[52px] h-[52px] shadow-sm !p-2'; | ||
| export let btnDefaultClass: $$Props['defaultClass'] = 'w-[52px] h-[52px] shadow-xs p-2!'; |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Consider standardizing shadow values across components.
While the padding change from !p-2 to p-2! is valid, the shadow value shadow-xs differs from the shadow-sm pattern used in other components.
Consider standardizing to shadow-sm for consistency:
- export let btnDefaultClass: $$Props['defaultClass'] = 'w-[52px] h-[52px] shadow-xs p-2!';
+ export let btnDefaultClass: $$Props['defaultClass'] = 'w-[52px] h-[52px] shadow-sm p-2!';Also applies to: 53-53
🏁 Script executed:
#!/bin/bash
# Check shadow value consistency across components
rg "shadow-(xs|sm)" --type-add 'svelte:*.svelte' -tsvelteLength of output: 4182
Shadow Value Consistency: Update for Uniform Styling
The change to reverse the padding flag (from !p-2 to p-2!) is valid. However, our codebase shows that several components (e.g., Footer.svelte, Table.svelte) use shadow-sm, while this component currently uses shadow-xs (both on line 22 and line 53). For consistency in the UI design, please consider updating the shadow value to shadow-sm.
- Action Required
- Change the shadow value on both lines 22 and 53 in
src/lib/speed-dial/SpeedDialButton.sveltefromshadow-xstoshadow-sm.
- Change the shadow value on both lines 22 and 53 in
Proposed diff:
- export let btnDefaultClass: $$Props['defaultClass'] = 'w-[52px] h-[52px] shadow-xs p-2!';
+ export let btnDefaultClass: $$Props['defaultClass'] = 'w-[52px] h-[52px] shadow-sm p-2!';| md: 'max-w-xl', | ||
| lg: 'max-w-2xl', | ||
| xl: 'max-w-screen-xl' | ||
| xl: 'max-w-(--breakpoint-xl)' |
There was a problem hiding this comment.
🛠️ Refactor suggestion
❓ Verification inconclusive
Verify CSS custom property and add fallback.
The change introduces a CSS custom property --breakpoint-xl which needs to be defined in your CSS. Consider adding a fallback value to prevent layout issues if the property is undefined.
- xl: 'max-w-(--breakpoint-xl)'
+ xl: 'max-w-(--breakpoint-xl, 1280px)'Run this script to check if the custom property is defined:
🏁 Script executed:
#!/bin/bash
# Search for --breakpoint-xl definition in CSS files
rg --type css "(?<!-)--breakpoint-xl\s*:"Length of output: 273
Action Required: Verify CSS Custom Property for 'xl' breakpoint and Add Fallback
It appears that the use of the CSS custom property --breakpoint-xl in src/lib/cards/Card.svelte (line 50) is intended to offer dynamic responsive styling. However, our initial attempt to search for its definition using rg failed due to regex limitations (look-around support missing). Please manually verify that --breakpoint-xl is defined in your CSS (e.g., try running with the --pcre2 flag:
rg --pcre2 --type css '(?<!-)--breakpoint-xl\s*:') or confirm that it is defined elsewhere in the project.
If the custom property is not defined or you wish to ensure a robust fallback mechanism, consider updating the breakpoint definition as follows:
- Current:
xl: 'max-w-(--breakpoint-xl)'
- Suggested:
- xl: 'max-w-(--breakpoint-xl)' + xl: 'max-w-(--breakpoint-xl, 1280px)'
Please verify the definition and add or update the fallback value as needed.
| export let normalClass: string = ''; | ||
| export let disabledClass: string = 'text-gray-900 bg-gray-100 dark:bg-gray-600 dark:text-gray-400'; | ||
| export let focusClass: string = 'focus:z-40 focus:outline-none focus:ring-2 focus:ring-primary-700 focus:text-primary-700 dark:focus:ring-gray-500 dark:focus:text-white'; | ||
| export let focusClass: string = 'focus:z-40 focus:outline-hidden focus:ring-2 focus:ring-primary-700 focus:text-primary-700 dark:focus:ring-gray-500 dark:focus:text-white'; |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify accessibility impact of focus outline change.
The change from focus:outline-none to focus:outline-hidden might affect keyboard navigation accessibility. Let's verify this change in Tailwind 4.0.
Also applies to: 56-56
🌐 Web query:
What is the difference between focus:outline-none and focus:outline-hidden in Tailwind CSS v4.0 regarding accessibility?
💡 Result:
Tailwind CSS's focus:outline-none utility addresses accessibility by setting outline: 2px solid transparent with a 2px offset[1][4]. This ensures visible focus indicators for Windows high contrast mode users while hiding outlines visually in standard modes[1][5].
The provided search results do not mention focus:outline-hidden as an official Tailwind CSS utility (v1-v3 documentation shown). However, we can analyze potential differences conceptually:
| Aspect | focus:outline-none (Tailwind default) |
Hypothetical focus:outline-hidden |
|---|---|---|
| CSS Output | outline: 2px solid transparent |
Potentially outline: 0/none |
| Accessibility Impact | Preserves WCAG-compliant focus ring | Likely breaks accessibility |
| High Contrast Mode | Visible focus indicator | No visible indicator |
| Recommended Usage | Default accessible solution | Not recommended |
Key accessibility considerations:
- Transparent outlines maintain focus visibility for 57 million Windows high contrast mode users[1][8]
- Removing outlines completely (
outline: 0) violates WCAG 2.1 success criterion 2.4.7 (Visible Focus)[5][8] - Tailwind's approach allows custom focus styles through utilities like
focus:ringwhile maintaining baseline accessibility[4][7]
For v4.0 implementations:
- Always pair
focus:outline-nonewith alternative visible focus indicators like:<button class="focus:outline-none focus:ring-2 focus:ring-blue-600"> Accessible button </button>
- Never use raw CSS
outline: nonewithout fallbacks[8][10]
The search results show Tailwind prioritizes accessibility through its transparent outline implementation rather than complete removal[1][4][5]. Any hypothetical outline-hidden utility would need equivalent accessibility safeguards to meet WCAG standards.
Citations:
- 1: https://v1.tailwindcss.com/docs/outline
- 2: https://jmperezperez.com/blog/outline-focus-ring-a11y/
- 3: outline-none doesn't work on button with focus in chrome tailwindlabs/tailwindcss#1231
- 4: https://v3.tailwindcss.com/docs/outline-style
- 5: https://medienbaecker.com/articles/focus-outlines
- 6: https://css-tricks.com/the-focus-visible-trick/
- 7: https://sentry.io/answers/how-to-remove-focus-border-outline-around-text-input-boxes/
- 8: https://www.a11yproject.com/posts/never-remove-css-outlines/
- 9: https://laracasts.com/discuss/channels/general-discussion/tailwind-css-1
- 10: https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible
Accessibility Impact of Focus Outline Change
The change from focus:outline-none to focus:outline-hidden is concerning because:
- Utility Validity: There is no official Tailwind CSS v4.0 documentation for a
focus:outline-hiddenutility. The documentedfocus:outline-nonesets a transparent outline (e.g.,outline: 2px solid transparent), which maintains a fallback focus indicator for high contrast modes. - Accessibility Risks: Removing outlines entirely (if
focus:outline-hiddenequates tooutline: noneor doesn't provide a transparent fallback) could break accessibility requirements, particularly the WCAG 2.1 success criterion for visible focus indicators. - Existing Focus Styles: Although the element includes
focus:ring-2and related classes to provide a focus ring, it's critical to ensure that these styles reliably display the focus indicator in all scenarios, especially iffocus:outline-hiddenoverrides the default behavior expected from Tailwind.
Action Items:
- Confirm whether
focus:outline-hiddenis an intended and supported utility in Tailwind CSS v4.0 or if it's a custom implementation. - Verify that the focus ring styles (
focus:ring-2 focus:ring-primary-700and their dark mode equivalents) adequately compensate for the removed outline to ensure keyboard navigation remains fully accessible. - Review the accessibility impact across different browsers and high contrast modes.
Please address these points to ensure that the component meets accessibility standards.
|
|
||
| export let value: $$Props['value'] = undefined; | ||
| export let wrappedClass: $$Props['wrappedClass'] = 'block w-full text-sm border-0 px-0 bg-inherit dark:bg-inherit focus:outline-none focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50'; | ||
| export let wrappedClass: $$Props['wrappedClass'] = 'block w-full text-sm border-0 px-0 bg-inherit dark:bg-inherit focus:outline-hidden focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50'; |
There was a problem hiding this comment.
Verify accessibility of hidden focus outline.
The change from focus:outline-none to focus:outline-hidden might affect keyboard navigation accessibility. Ensure that the focus state remains visible for keyboard users.
Consider using focus:ring or similar alternative to maintain visible focus indicators:
-focus:outline-hidden focus:ring-0
+focus:outline-none focus:ring-2 focus:ring-primary-500Also applies to: 60-60
| export let border: $$Props['border'] = false; | ||
| export let href: $$Props['href'] = ''; | ||
| export let rounded: $$Props['rounded'] = false; | ||
| export let rounded: $$Props['rounded-sm'] = false; |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify Tailwind class compatibility.
The change from rounded to rounded-sm appears to be part of the Tailwind 4.0 upgrade. Let's verify that this class exists in the new version.
Also applies to: 81-81
🌐 Web query:
Does Tailwind CSS 4.0 support the rounded-sm class?
💡 Result:
Tailwind CSS 4.0 introduces changes to border radius class naming conventions. The rounded-sm class from previous versions has been renamed to rounded-xs in Tailwind CSS 4.0[4]. This is part of a broader update to ensure consistent naming across utilities like blur, shadow, and border radius scales[4].
Key changes:
rounded→rounded-sm(equivalent to previous default)rounded-sm→rounded-xs[4]
The new syntax maintains backward compatibility through automatic migration tools[8], but developers should update their codebases to use rounded-xs for equivalent styling in new projects[4]. Existing projects using older versions can still use rounded-sm, but this class won't work as expected in Tailwind 4.0 installations without configuration adjustments[4][8].
Citations:
- 1: https://tailwindcss.com/docs/border-radius
- 2: https://tailscan.com/tailwind/borders/rounded-sm
- 3: https://daily.dev/blog/tailwind-css-40-everything-you-need-to-know-in-one-place
- 4: https://www.penguinui.com/blog/penguin-ui-tailwind-css-v4-update
- 5: https://www.tailwindtap.com/blog/tailwind-css-border-radius-guide
- 6: https://v3.tailwindcss.com/docs/border-radius
- 7: https://tailkits.com/blog/tailwind-css-rounded-classes-guide/
- 8: https://tailwindcss.com/blog/tailwindcss-v4
- 9: https://windframe.dev/tailwind/classes/tailwind-border-radius
- 10: Tailwind 4.0? tailwindlabs/tailwindcss#8441
Tailwind Class Update: Use rounded-xs Instead of rounded-sm
Based on Tailwind CSS 4.0 documentation, the formerly used rounded-sm class is now renamed to rounded-xs. Consequently, the snippet in src/lib/badge/Badge.svelte (line 30) and the similar change on line 81 should be updated to reflect this change to ensure proper styling.
| $: { | ||
| const _color = color === 'base' && background ? 'tinted' : color; | ||
| inputClass = twMerge([defaultClass, inputPadding[_size], ($$slots.left && leftPadding[_size]) || ((clearable || $$slots.right) && rightPadding[_size]), ringClasses[color], colorClasses[_color], borderClasses[_color], textSizes[_size], group || 'rounded-lg', group && 'first:rounded-s-lg last:rounded-e-lg', group && '[&:not(:first-child)]:-ms-px', $$props.class]); | ||
| inputClass = twMerge([defaultClass, inputPadding[_size], ($$slots.left && leftPadding[_size]) || ((clearable || $$slots.right) && rightPadding[_size]), ringClasses[color], colorClasses[_color], borderClasses[_color], textSizes[_size], group || 'rounded-lg', group && 'first:rounded-s-lg last:rounded-e-lg', group && 'not-first:-ms-px', $$props.class]); |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify new selector syntax compatibility.
The change from [&:not(:first-child)]:-ms-px to not-first:-ms-px simplifies the selector. Let's verify this new syntax is supported.
🌐 Web query:
Does Tailwind CSS 4.0 support the not-first: modifier?
💡 Result:
Tailwind CSS 4.0 introduces enhanced pseudo-class handling through its new not-* variant system[1][3][5]. While there's no explicit not-first: modifier listed in core variants[5], you can achieve equivalent functionality using arbitrary values:
<div class="not-[&:first-child]:bg-red-500">
<!-- Applies red background to all elements except first child -->
</div>This leverages:
- The new
not-*variant supporting CSS:not()pseudo-class[1] - Arbitrary value syntax for custom selectors[5]
- Native CSS pseudo-class compatibility (
:first-child)[5]
The implementation works by combining:
.not-\[&\:first-child\]\:bg-red-500:not(:first-child) {
background-color: rgb(239 68 68);
}For comparison with other structural modifiers:
| Modifier | Example | CSS Equivalent |
|---|---|---|
first: |
first:mt-0 |
&:first-child |
last: |
last:mb-0 |
&:last-child |
| Custom negation | not-[&:first-child]:bg-red |
&:not(:first-child) |
This approach maintains Tailwind's utility-first philosophy while enabling complex selector logic through arbitrary values[3][5]. The not-* variant also supports media query negation (not-supports-grid:flex) and other advanced use cases[1][5].
Citations:
- 1: https://tailwindcss.com/blog/tailwindcss-v4
- 2: css modifier only partialy supported? tailwindlabs/tailwindcss#7641
- 3: https://tailwindcss.com/blog/tailwindcss-v4-alpha
- 4: https://tailwindcss.com/docs/compatibility
- 5: https://tailwindcss.com/docs/hover-focus-and-other-states
- 6: https://www.youtube.com/watch?v=ud913ekwAOQ
- 7: https://www.youtube.com/watch?v=vven8nXn1wk
- 8: `@apply`Broken in Tailwind CSS v4.0 – No Clear Fix or Docs! tailwindlabs/tailwindcss#16429
- 9: [SOLVED]active modifier class absent in tailwindcss tailwindlabs/tailwindcss#3198
- 10: https://tailkit.com/blog/everything-you-need-to-know-about-tailwind-css-v4
Action required: Update selector syntax to ensure compatibility with Tailwind CSS 4.0
The change from [&:not(:first-child)]:-ms-px to not-first:-ms-px simplifies the code, but according to Tailwind CSS 4.0 documentation, there isn’t native support for a plain not-first: modifier. To achieve the same effect, you should use the arbitrary variant syntax. For instance, replacing it with:
not-[&:first-child]:-ms-px
would be more in line with Tailwind’s enhanced pseudo-class handling. Please update the code accordingly to avoid potential issues during styling.
| <Badge color="dark" rounded-sm large class="p-1! font-semibold!"> | ||
| <CheckOutline class="h-3 w-3" /> | ||
| <span class="sr-only">Icon description</span> | ||
| </Badge> | ||
| <Badge rounded large class="!p-1 !font-semibold"> | ||
| <Badge rounded large class="p-1! font-semibold!"> | ||
| <CheckOutline class="h-3 w-3 text-primary-800 dark:text-primary-400" /> | ||
| <span class="sr-only">Icon description</span> | ||
| </Badge> |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Ensure Consistent Rounded Property in Icon-Only Badges
In the “Badge with icon only” section, the first badge example correctly uses rounded-sm, while the second still uses rounded. For a consistent design, please update the second example to also use rounded-sm if appropriate. Additionally, review the use of trailing exclamation marks (e.g., in p-1! font-semibold!) to ensure they conform with Tailwind 4.0’s syntax.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Closes #
📑 Description
Status
✅ Checks
ℹ Additional Information
Summary by CodeRabbit