-
Notifications
You must be signed in to change notification settings - Fork 214
refactor: update Accordion article to Aura theme #4845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,99 +109,6 @@ endif::[] | |
| -- | ||
|
|
||
|
|
||
| == Theme Variants | ||
|
|
||
| Accordion has three theme variants: `filled`, `small`, and `reverse`. Set the theme attribute separately for each panel, not on Accordion itself. Theme names can be combined with each other. For example, all three themes variants can be applied to a panel. | ||
|
|
||
| // TODO example would be nice to have | ||
|
|
||
| === Filled Panels | ||
|
|
||
| The `filled` theme variant makes the panel's boundaries visible. This helps tie its content together visually and distinguishes it from the surrounding UI. | ||
|
|
||
| [.example] | ||
| -- | ||
|
|
||
| ifdef::lit[] | ||
| [source,html] | ||
| ---- | ||
| include::{root}/frontend/demo/component/accordion/accordion-filled-panels.ts[render,tags=snippet,indent=0,group=Lit] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| ifdef::flow[] | ||
| [source,java] | ||
| ---- | ||
| include::{root}/src/main/java/com/vaadin/demo/component/accordion/AccordionFilledPanels.java[render,tags=snippet,indent=0,group=Flow] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| ifdef::react[] | ||
| [source,tsx] | ||
| ---- | ||
| include::{root}/frontend/demo/component/accordion/react/accordion-filled-panels.tsx[render,tags=snippet,indent=0,group=React] | ||
| ---- | ||
| endif::[] | ||
| -- | ||
|
|
||
| === Small Panels | ||
|
|
||
| Use the `small` theme variant for compact UIs. | ||
|
|
||
| [.example] | ||
| -- | ||
|
|
||
| ifdef::lit[] | ||
| [source,html] | ||
| ---- | ||
| include::{root}/frontend/demo/component/accordion/accordion-small-panels.ts[render,tags=snippet,indent=0,group=Lit] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| ifdef::flow[] | ||
| [source,java] | ||
| ---- | ||
| include::{root}/src/main/java/com/vaadin/demo/component/accordion/AccordionSmallPanels.java[render,tags=snippet,indent=0,group=Flow] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| ifdef::react[] | ||
| [source,tsx] | ||
| ---- | ||
| include::{root}/frontend/demo/component/accordion/react/accordion-small-panels.tsx[render,tags=snippet,indent=0,group=React] | ||
| ---- | ||
| endif::[] | ||
| -- | ||
|
|
||
| === Reverse Panels | ||
|
|
||
| The `reverse` theme variant places the toggle icon after the summary contents. This can be useful for aligning visually the summary with other content. | ||
|
|
||
| [.example] | ||
| -- | ||
|
|
||
| ifdef::lit[] | ||
| [source,html] | ||
| ---- | ||
| include::{root}/frontend/demo/component/accordion/accordion-reverse-panels.ts[render,tags=snippet,indent=0,group=Lit] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| ifdef::flow[] | ||
| [source,java] | ||
| ---- | ||
| include::{root}/src/main/java/com/vaadin/demo/component/accordion/AccordionReversePanels.java[render,tags=snippet,indent=0,group=Flow] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| ifdef::react[] | ||
| [source,tsx] | ||
| ---- | ||
| include::{root}/frontend/demo/component/accordion/react/accordion-reverse-panels.tsx[render,tags=snippet,indent=0,group=React] | ||
| ---- | ||
| endif::[] | ||
| -- | ||
|
|
||
| == Disabled Panels | ||
|
|
||
| Accordion panels can be disabled to prevent them from being expanded or collapsed. Details can also be disabled to prevent them from being expanded or collapsed. Components inside a disabled expanded panel are automatically disabled as well. | ||
|
|
@@ -241,7 +148,7 @@ Details can be used instead of Accordion when there is a need to see content fro | |
|
|
||
| Accordions can be used to break a complex form into smaller step-by-step sections. | ||
|
|
||
| The expandable and collapsible nature of accordions can sometimes be difficult for users to discover. Use the <<filled-panels,filled variant>> and apply [since:com.vaadin:[email protected]]##<<../tooltip#,tooltips>>## on the panels to make this more discoverable. | ||
| The expandable and collapsible nature of accordions can sometimes be difficult for users to discover. Use the <<styling#filled-panels,filled variant>> and apply [since:com.vaadin:[email protected]]##<<../tooltip#,tooltips>>## on the panels to make this more discoverable. | ||
|
|
||
|
|
||
| == Related Components | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,92 @@ | |||||
| --- | ||||||
| = Accordion Styling | ||||||
|
|
||||||
| == Style Variants | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There probably should be a paragraph about how to apply style variants with a code snippet, especially since the terminology is now different from the |
||||||
|
|
||||||
| Accordion supports the following style variants. Variants must be applied to individual panels, not to the Accordion itself. | ||||||
|
|
||||||
| [cols="1,3,1"] | ||||||
| |=== | ||||||
| | Variant | Description | Supported by | ||||||
|
|
||||||
| |`filled` | ||||||
| |The filled theme variant makes the panel’s boundaries visible | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's probably align wording here with other variants below:
Suggested change
|
||||||
| |Aura, Lumo | ||||||
|
|
||||||
| |`no-padding` | ||||||
| |Removes the padding from the panel content area | ||||||
| |Aura | ||||||
|
|
||||||
| |`small` | ||||||
| |Used for compact UIs | ||||||
|
Check failure on line 27 in articles/components/accordion/styling.adoc
|
||||||
| | Lumo | ||||||
|
|
||||||
| |`reverse` | ||||||
| |Places the toggle icon after the summary contents | ||||||
| |Aura, Lumo | ||||||
|
|
||||||
| |=== | ||||||
|
|
||||||
|
|
||||||
| === Filled Panels | ||||||
|
|
||||||
| The `filled` theme variant makes the panel's boundaries visible. This helps tie its content together visually and distinguishes it from the surrounding UI. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's use "style variant" consistently:
Suggested change
|
||||||
|
|
||||||
| [.example] | ||||||
| -- | ||||||
|
|
||||||
| ifdef::lit[] | ||||||
| [source,html] | ||||||
| ---- | ||||||
| include::{root}/frontend/demo/component/accordion/accordion-filled-panels.ts[render,tags=snippet,indent=0,group=Lit] | ||||||
| ---- | ||||||
| endif::[] | ||||||
|
|
||||||
| ifdef::flow[] | ||||||
| [source,java] | ||||||
| ---- | ||||||
| include::{root}/src/main/java/com/vaadin/demo/component/accordion/AccordionFilledPanels.java[render,tags=snippet,indent=0,group=Flow] | ||||||
| ---- | ||||||
| endif::[] | ||||||
|
|
||||||
| ifdef::react[] | ||||||
| [source,tsx] | ||||||
| ---- | ||||||
| include::{root}/frontend/demo/component/accordion/react/accordion-filled-panels.tsx[render,tags=snippet,indent=0,group=React] | ||||||
| ---- | ||||||
| endif::[] | ||||||
| -- | ||||||
|
|
||||||
| === Reverse Panels | ||||||
|
|
||||||
| The `reverse` theme variant places the toggle icon after the summary contents. This can be useful for aligning visually the summary with other content. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, let's use "style variant" consistently:
Suggested change
|
||||||
|
|
||||||
| [.example] | ||||||
| -- | ||||||
|
|
||||||
| ifdef::lit[] | ||||||
| [source,html] | ||||||
| ---- | ||||||
| include::{root}/frontend/demo/component/accordion/accordion-reverse-panels.ts[render,tags=snippet,indent=0,group=Lit] | ||||||
| ---- | ||||||
| endif::[] | ||||||
|
|
||||||
| ifdef::flow[] | ||||||
| [source,java] | ||||||
| ---- | ||||||
| include::{root}/src/main/java/com/vaadin/demo/component/accordion/AccordionReversePanels.java[render,tags=snippet,indent=0,group=Flow] | ||||||
| ---- | ||||||
| endif::[] | ||||||
|
|
||||||
| ifdef::react[] | ||||||
| [source,tsx] | ||||||
| ---- | ||||||
| include::{root}/frontend/demo/component/accordion/react/accordion-reverse-panels.tsx[render,tags=snippet,indent=0,group=React] | ||||||
| ---- | ||||||
| endif::[] | ||||||
| -- | ||||||
|
|
||||||
|
|
||||||
| include::../_styling-section-intros.adoc[tag=selectors] | ||||||
|
|
||||||
| Root element:: `vaadin-accordion` | ||||||
|
|
||||||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably remove "since" tag from here as it was only relevant for V23 docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove all [since] annotations from v25 docs (and any [since v23] annotations from v24 docs).