Repository navigation
feat(splitter): add default-size and small, medium and large steps to the schema - #683
Conversation
- The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px and the expanders 4px, 5px or 6px high. The default size is small, so a splitter without `--ig-size` renders as before. - The steps are internal: the styles add them to the `size` token, so the handle can't be set thicker than the bar, and `--ig-splitter-size` still sets the small size. - The drag handle radius is the `border-radius` token, whose default is 2px, 8px, 8px by size. A value that you set applies at every size. - The Indigo idle bar stays 1px thick at every size. - The 48px margins around the drag handle shrink when the bar is too short, so the handle keeps 25% of the bar length and the expanders stay inside the bar. Needs the igniteui-theming release with IgniteUI/igniteui-theming#683. Closes #2634.
064fd87 to
1d35b26
Compare
- The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px and the expanders 4px, 5px or 6px high. The default size is small, so a splitter without `--ig-size` renders as before. - The steps are internal: the styles add them to the `size` token, so the handle can't be set thicker than the bar, and `--size` and `--ig-splitter-size` still set the small size. - The drag handle radius is the `border-radius` token, whose default is 2px, 8px, 8px by size. A value that you set applies at every size. - The Indigo idle bar stays 1px thick at every size. - The 48px margins around the drag handle shrink when the bar is too short, so the handle keeps 25% of the bar length and the expanders stay inside the bar. - The internal `--splitter-size` custom property is removed. Needs the igniteui-theming release with IgniteUI/igniteui-theming#683. Closes #18013.
- The splitter schema defaults to small: `default-size: 1`. - The default of `border-radius`, the drag handle radius, has a step for each size: 2px, 8px, 8px, each scaled by the radius factor. A passed `$border-radius` is one value, so it applies at every size. - `size` keeps its value, so component versions without sizing compile as before. The components add the bar, handle and expander steps to it themselves, so a theme can't set a handle thicker than its bar. Closes #682.
- The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px and the expanders 4px, 5px or 6px high. The default size is small, so a splitter without `--ig-size` renders as before. - The steps are internal: the styles add them to the `size` token, so the handle can't be set thicker than the bar, and `--size` and `--ig-splitter-size` still set the small size. - The drag handle radius is the `border-radius` token, whose default is 2px, 8px, 8px by size. A value that you set applies at every size. - The Indigo idle bar stays 1px thick at every size. - The 48px margins around the drag handle shrink when the bar is too short, so the handle keeps 25% of the bar length and the expanders stay inside the bar. - The internal `--splitter-size` custom property is removed. Needs the igniteui-theming release with IgniteUI/igniteui-theming#683. Closes #18013.
1d35b26 to
16acf92
Compare
- The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px and the expanders 4px, 5px or 6px high. The default size is small, so a splitter without `--ig-size` renders as before. - The steps are internal: the styles add them to the `size` token, so the handle can't be set thicker than the bar, and `--ig-splitter-size` still sets the small size. - The drag handle radius is the `border-radius` token, whose default is 2px, 8px, 8px by size. A value that you set applies at every size. - The Indigo idle bar stays 1px thick at every size. - The 48px margins around the drag handle shrink when the bar is too short, so the handle keeps 25% of the bar length and the expanders stay inside the bar. Needs the igniteui-theming release with IgniteUI/igniteui-theming#683. Closes #2634.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the size-aware splitter defaults.
No open issues 🎉
What changed in this PR
Adds size-aware defaults to the shared splitter schema so Angular and Web Components can support --ig-size, while preserving the numeric thickness token and public theme parameters.
Changes:
- Sets the default size to small and defines handle radii of 2px, 8px, and 8px, scaled by the radius factor.
- Keeps
sizeatrem(4px)and explicit border-radius overrides uniform across sizes. - Updates SassDoc and adds four tests covering defaults, thickness, radius steps, and overrides.
| File | Description |
|---|---|
| packages/theming/tests/_themes.spec.scss | Adds splitter schema and override tests. |
| packages/theming/sass/themes/schemas/components/light/_splitter.scss | Adds the small default and size-dependent handle radii. |
| packages/theming/sass/themes/components/splitter/_splitter-theme.scss | Clarifies parameter documentation; no functional changes. |
Review effort: Balanced
- The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px and the expanders 4px, 5px or 6px high. The default size is small, so a splitter without `--ig-size` renders as before. - The steps are internal: the styles add them to the `size` token, so the handle can't be set thicker than the bar, and `--ig-splitter-size` still sets the small size. - The drag handle radius is the `border-radius` token, whose default is 2px, 8px, 8px by size. A value that you set applies at every size. - The Indigo idle bar stays 1px thick at every size. - The 48px margins around the drag handle shrink when the bar is too short, so the handle keeps 25% of the bar length and the expanders stay inside the bar. Needs the igniteui-theming release with IgniteUI/igniteui-theming#683. Closes #2634.
|
Two problems with the current shape, plus a cleaner way to write the radius steps. 1. The handle radius is 8px on components that don't set
|
…the schema - sizable() takes $default (1, 2 or 3). A component without the sizable() mixin gets that step, not the largest one. Without $default the output is the same as before. - A map argument of a sizable instruction is resolved as an instruction, so a schema can write sizable over border-radius. - The splitter border-radius is sizable over border-radius(2px), (8px), (8px) with small as the default step, so a released igx-splitter keeps its 2px handle radius. Refs #682.
|
All applied in fbc4da3.
SassDoc: all five applied. I also added |
simeonoff
left a comment
There was a problem hiding this comment.
Approving. All points from the review are addressed in fbc4da3, and tests and CI pass.
One more line for the release notes: the --is-* size flags inherit, so a splitter from an earlier component release (no sizable() on its host) placed inside a sized component such as a grid, list item or tile inherits that component's flags and can show the 8px medium/large handle radius instead of 2px. That lasts until the Angular and Web Components splitter PRs ship, since the splitter then sets its own flags. It only affects component lines that allow ^30.2.0 (Angular 22.3.x and Web Components master), and it's cosmetic, so it isn't a blocker.
…18017) * feat(splitter): follow --ig-size with small, medium and large bars - The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px and the expanders 4px, 5px or 6px high. The default size is small, so a splitter without `--ig-size` renders as before. - The steps are internal: the styles add them to the `size` token, so the handle can't be set thicker than the bar, and `--size` and `--ig-splitter-size` still set the small size. - The drag handle radius is the `border-radius` token, whose default is 2px, 8px, 8px by size. A value that you set applies at every size. - The Indigo idle bar stays 1px thick at every size. - The 48px margins around the drag handle shrink when the bar is too short, so the handle keeps 25% of the bar length and the expanders stay inside the bar. - The internal `--splitter-size` custom property is removed. Needs the igniteui-theming release with IgniteUI/igniteui-theming#683. Closes #18013. * feat(splitter): size the idle bar of the indigo theme by --ig-size - The idle Indigo bar is 1px, 4px or 8px thick at small, medium and large. Before, it was 1px at every size. Refs #18013. * feat(splitter): measure the 48px gap from the expander icon box - Each expander takes the 18px, 20px and 24px icon box of the design along the bar, 14px, 16px and 24px in the Indigo theme. - The drag handle is 48px from the box, so the triangle is 5px further away at small. Refs #18013. * build(deps): require igniteui-theming 30.3.0 for the sized splitter schema - The splitter styles read `default-size` and the sized `border-radius` from the schema, which `igniteui-theming` ships from 30.3.0. - The `igniteui-angular` package depends on `^30.3.0`, so a consumer gets a schema the styles compile with. - The nested `sass-embedded` copies under `igniteui-theming` dedupe to the root one. * feat(splitter): size the hitbox of the expanders to the icon box - The area of an expander that takes the pointer is the icon box of the design, centered on the arrow: 18px, 20px or 24px square, 14px, 16px or 24px in the Indigo theme. - Before, it was 4 by 3 times the arrow size in every theme: 16px by 12px at small. Closes #18013. * test(splitter): check the hitbox of the expanders in the default theme only * docs(splitter): list the default-size changes under General - CHANGELOG: the thicker bar for an app that already sets `--ig-size`, the new expander gap and click area, and the thinner Indigo idle bar with an overridden size are under General; New Functionality keeps the new sizes.
Closes #682.
The splitter schema gets a default size and a per-size handle radius, so
igc-splitterandigx-splittercan follow--ig-size(IgniteUI/igniteui-webcomponents#2634, IgniteUI/igniteui-angular#18013).Changes
Schema (
$light-splitter, inherited by the four themes, light and dark):default-size: 1.border-radius, the drag handle radius, has a step for each size: 2px, 8px, 8px, each scaled by--ig-radius-factor. Before, it was 2px. The schema writes it assizableover threeborder-radiusinstructions, with small as the default step.sizestaysrem(4px).A passed
$border-radius, or--ig-splitter-border-radiusset in CSS, is one value, so it applies at every size, as before.Sass:
sizable()takes$default(1, 2 or 3). A component without thesizable()mixin has no--is-*flags, so it gets the default step. Without$defaultit gets the largest step, as before, and the output of every other component is the same. Any other value is an error.sizableinstruction is resolved as an instruction of its own, so a schema can writesizableoverborder-radius. Asizableinstruction of plain values resolves as before.border-radius: ( sizable: ( (border-radius: rem(2px)), (border-radius: rem(8px)), (border-radius: rem(8px)), 1, ), ),Why there are no tokens for the bar, the handle and the expanders
The components add the per-size steps to
sizethemselves (bar +2/8/14px, handle +0/2/4px, expanders +0/1/2px). Three separate tokens would let a theme set a handle thicker than its bar.sizestays the one token for the thickness: it sets the small size and every step moves with it. #682 is updated to say the same.What stays the same
igniteui-angular(themes/_base.scss) andigniteui-webcomponents(splitter.indigo.scss) readsizeas a number at compile time. It keeps its value, so they compile as before.border-radiuswithvar(). Releasedigx-splitterdoes not include thesizable()mixin, so it resolves the radius to the default step, 2px, as before. Released Web Components sets no--component-sizeon the splitter, so it resolves to the small step, 2px, too.avatar-theme()andchip-theme()return the samesizeas onmaster, and the compiledtests/e2e/theme.cssis identical to the one ofmaster.splitter-theme()keeps its parameters.Known limit
_abs()wraps eachclamp()of the radius asmax(clamp(…), -1 * clamp(…)). It only adds to the output size and is left for a follow-up.Release notes
default-size: 1, and its defaultborder-radiusis 2px, 8px, 8px by size.tokens()no longer has--ig-splitter-border-radiusat the root, because the global mode skips sizable values. The component falls back to its own default, and a--ig-splitter-border-radiusthat you set still applies at every size. CSS that reads the token without setting it gets no value.sizable()has a new optional$defaultparameter.Tests
packages/theming/tests/_themes.spec.scss:Sizing, 4 new tests:Splitter, 4 tests:sizable(border-radius(...), ..., 1).npm run lint,npm run buildandnpm testpass: 42 files, 1543 tests (1535 onmaster).Notes
sizable()page of the MCP knowledge base describes$default.