Skip to content

Docs update to classes#1682

Merged
shinokada merged 1 commit intothemesberg:mainfrom
jjagielka:classes_doc
Jul 17, 2025
Merged

Docs update to classes#1682
shinokada merged 1 commit intothemesberg:mainfrom
jjagielka:classes_doc

Conversation

@jjagielka
Copy link
Copy Markdown
Contributor

@jjagielka jjagielka commented Jul 17, 2025

📑 Description

Quick introduction of the classes prop in docs.

Status

  • Not Completed
  • Completed

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • I have checked the page with https://validator.unl.edu/
  • All the tests have passed
  • My pull request is based on the latest commit (not the npm version).

ℹ Additional Information

Summary by CodeRabbit

  • Documentation
    • Expanded and clarified instructions for customizing component classes.
    • Introduced and documented the new recommended classes prop for easier customization.
    • Updated examples to demonstrate the new approach.
    • Marked older multiple class props as deprecated.
    • Improved text for clarity and highlighted visual effects of customization.

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 17, 2025

@jjagielka is attempting to deploy a commit to the Themesberg Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 17, 2025

Walkthrough

The documentation for customizing component classes in Flowbite Svelte has been updated. It now introduces and recommends a new classes prop for class customization, replacing multiple individual class props. The documentation includes updated examples, marks the older approach as deprecated, and provides clearer instructions.

Changes

File(s) Change Summary
src/routes/docs/pages/customization.md Expanded and clarified documentation on component class customization; introduced classes prop, updated examples, marked old props as deprecated, and improved instructional text.

Possibly related PRs

Poem

In the docs a new path we pave,
With classes prop, so neat and brave.
No more juggling classDiv or classInner,
Just one object—so much simpler!
The bunny hops with joy and pride,
As customization’s now simplified.
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/routes/docs/pages/customization.md (2)

64-65: Fix typos and grammar

  1. intrducingintroducing
  2. Missing comma after clause.
-Instead of intrducing multiple props for component's internal element classes new prop `classes` has been introduced: an object of internal element names and desired new classes.
+Instead of introducing multiple props for a component’s internal element classes, a new prop `classes` has been introduced. It accepts an object whose keys are internal element names and whose values are the desired classes.

79-79: Clarify deprecation notice

Explicitly state which props are deprecated (classDiv, innerClass, etc.) and from which version, so consumers can plan migrations.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e154fe6 and a1efd12.

📒 Files selected for processing (1)
  • src/routes/docs/pages/customization.md (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components, both the regular focus styling (controlled by ringClasses) and focus-within styling need to be dynamically adjusted based on validation state. For proper validation styling, create separate objects for focus-within classes (like focusWithinClasses) that use the same color as ringClasses when inputInvalid=true.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T12:47:33.307Z
Learning: In the Flowbite Svelte library's composite form components like MultiInput, when implementing focus styles with focus-within, create a dedicated focusWithinClasses object with appropriate colors for each state (base, primary, green, red). Using just 'focus-within:ring-1' without color specification won't correctly apply color-specific styling when the input receives focus directly.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components like MultiInput, when handling focus states for validation, avoid hardcoding focus-within classes like 'focus-within:border-primary-500'. Instead, create a dynamic mapping object (e.g., focusWithinClasses) that changes the focus ring color based on the current color state, especially when inputInvalid=true.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:11:53.952Z
Learning: In the Flowbite Svelte library, when implementing components with validation states, the 'inputInvalid' property should be explicitly defined and passed to the Wrapper component. When inputInvalid=true, the color should be set to "red" to ensure the ring/border styling is applied correctly.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:11:53.953Z
Learning: In the Flowbite Svelte library's MultiInput component, the 'inputInvalid' property should be exported and passed to the Wrapper component to properly style the component's ring with red color when validation fails, similar to how the Input component handles validation states.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T12:47:33.307Z
Learning: In the Flowbite Svelte library's composite form components like MultiInput, when implementing focus styles, ensure both the container (with focus-within) and the inner input element (with direct focus) have dynamic styling based on the validation state. The input element needs its own focus styles that change to red when inputInvalid=true.
src/routes/docs/pages/customization.md (3)
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components, both the regular focus styling (controlled by ringClasses) and focus-within styling need to be dynamically adjusted based on validation state. For proper validation styling, create separate objects for focus-within classes (like focusWithinClasses) that use the same color as ringClasses when inputInvalid=true.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components like MultiInput, when handling focus states for validation, avoid hardcoding focus-within classes like 'focus-within:border-primary-500'. Instead, create a dynamic mapping object (e.g., focusWithinClasses) that changes the focus ring color based on the current color state, especially when inputInvalid=true.
Learnt from: superstes
PR: themesberg/flowbite-svelte#0
File: :0-0
Timestamp: 2025-03-20T12:47:33.307Z
Learning: In the Flowbite Svelte library's composite form components like MultiInput, when implementing focus styles with focus-within, create a dedicated focusWithinClasses object with appropriate colors for each state (base, primary, green, red). Using just 'focus-within:ring-1' without color specification won't correctly apply color-specific styling when the input receives focus directly.
🔇 Additional comments (1)
src/routes/docs/pages/customization.md (1)

74-76: Ignore this suggestion: insideDiv is the correct key

The Banner component’s classes prop expects insideDiv (and dismissable) keys—innerClass is the deprecated standalone prop. No changes needed here.

Likely an incorrect or invalid review comment.

Comment on lines +47 to +58
```svelte example class="flex flex-col relative"
<script>
import { Banner, Skeleton, ImagePlaceholder } from "flowbite-svelte";
</script>

<Skeleton class="py-4" />
<ImagePlaceholder class="py-4" />

<Banner id="default-banner" type="bottom" class="border-green-600 bg-green-700 dark:border-green-400 dark:bg-green-500" innerClass="text-white">
<p class="flex items-center text-sm font-normal">Overwriting divClass and innerClass</p>
</Banner>
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Example uses wrong / deprecated prop names

The snippet still shows innerClass, but the paragraph above claims classInner or classDiv. Align the example so it matches the final, recommended names.

-<Banner id="default-banner" type="bottom" class="border-green-600 bg-green-700 dark:border-green-400 dark:bg-green-500" innerClass="text-white">
+<Banner
+  id="default-banner"
+  type="bottom"
+  class="border-green-600 bg-green-700 dark:border-green-400 dark:bg-green-500"
+  innerClass="text-white"
+>

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/routes/docs/pages/customization.md around lines 47 to 58, the example
uses the deprecated prop name innerClass for the Banner component, while the
text above recommends using classInner or classDiv. Update the example to
replace innerClass with the correct prop name classInner or classDiv as per the
documentation to ensure consistency and correctness.

Comment on lines +43 to +46
While the `class` prop can be used for most components, some components with a complex structure may require multiple props.

For instance, let's consider [the Banner component](https://next.flowbite-svelte.com/docs/components/banner#component-data) has two relevant props: `class` for `div` and `classInner` for `innerClass`. To overwrite the `div`, you can use the `classDiv` prop:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Prop-name inconsistencies will confuse readers

You mix three different identifiers for the same Banner prop: classInner, innerClass, and classDiv. Please standardise on the actual API names (per current source it’s innerClass and class) or readers will waste time hunting for the correct prop.

-... two relevant props: `class` for `div` and `classInner` for `innerClass`. To overwrite the `div`, you can use the `classDiv` prop:
+... two relevant props: `class` for the outer `<div>` and `innerClass` for the inner wrapper. To overwrite the outer `<div>`, use the `class` prop:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
While the `class` prop can be used for most components, some components with a complex structure may require multiple props.
For instance, let's consider [the Banner component](https://next.flowbite-svelte.com/docs/components/banner#component-data) has two relevant props: `class` for `div` and `classInner` for `innerClass`. To overwrite the `div`, you can use the `classDiv` prop:
While the `class` prop can be used for most components, some components with a complex structure may require multiple props.
For instance, let's consider [the Banner component](https://next.flowbite-svelte.com/docs/components/banner#component-data) has two relevant props: `class` for the outer `<div>` and `innerClass` for the inner wrapper. To overwrite the outer `<div>`, use the `class` prop:
🤖 Prompt for AI Agents
In src/routes/docs/pages/customization.md around lines 43 to 46, the
documentation inconsistently refers to the Banner component props as
`classInner`, `innerClass`, and `classDiv`. To fix this, standardize all prop
names to match the actual API, which uses `class` for the div and `innerClass`
for the inner element. Replace all incorrect prop names with these correct ones
to avoid reader confusion.

@shinokada shinokada merged commit 97f8514 into themesberg:main Jul 17, 2025
1 of 2 checks passed
@jjagielka jjagielka deleted the classes_doc branch July 17, 2025 08:21
@coderabbitai coderabbitai bot mentioned this pull request Jul 17, 2025
8 tasks
@coderabbitai coderabbitai bot mentioned this pull request Dec 28, 2025
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants