Repository navigation
feat(splitter): follow --ig-size with small, medium and large bars - #18017
Conversation
a411ee3 to
57d4e8f
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.
57d4e8f to
d9b64eb
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new default-size lookup breaks Sass compilation with the currently locked and permitted theming version, requiring a compatible theming release and updates to both manifests and the lockfile.
1 open issue
What changed in this PR
Adds --ig-size support to the Angular splitter, introducing small, medium, and large sizes while keeping small as the default.
Changes:
- Scales bars, handles, expanders, and hitboxes, while preserving Indigo’s 1px idle bar.
- Adjusts handle spacing on short bars and adds sizing regression tests.
- Documents sizing behavior, overrides, and layout changes.
| File | Description |
|---|---|
| projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss | Adapts idle scaling and hitboxes to bar thickness. |
| projects/igniteui-angular/splitter/src/splitter/themes/_base.scss | Adds size steps and responsive short-bar spacing. |
| projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts | Tests sizing, overrides, and handle spacing. |
| projects/igniteui-angular/splitter/README.md | Documents size selection and token overrides. |
| CHANGELOG.md | Records sizing support and the short-bar layout fix. |
Review effort: Balanced
- The idle Indigo bar is 1px, 4px or 8px thick at small, medium and large. Before, it was 1px at every size. Refs #18013.
- 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.
|
Both are in, here and in IgniteUI/igniteui-webcomponents#2635. Indigo idle bar: 1px, 4px and 8px at small, medium and large. On hover and focus it takes the full thickness of the size, as before. Margins from the container: the 48px now starts from the icon container, 18px, 20px and 24px, and 14px, 16px and 24px in Indigo. The arrows stay CSS triangles (8px, 10px and 12px long), so the triangle itself is 5px, 5px and 6px further from the handle, and 3px, 3px and 6px in Indigo. |
|
The small container around the expander in Indigo still follows the size of the rest of the themes. The size of the small container of the expander in Indigo theme should be: Small: 14px |
…chema - 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.
- 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.
simeonoff
left a comment
There was a problem hiding this comment.
Thanks, this matches IgniteUI/igniteui-webcomponents#2635 and the igniteui-theming@30.3.0 schema: the size steps, the Indigo idle bar, the icon box, the hitboxes and the short-bar clamp() all line up. Two small things:
1. CHANGELOG: list the behaviour changes under ### General
The entry is under New Functionality, but it includes changes that apps get without opting in:
- an app that already sets
--ig-sizeto medium or large gets a thicker bar; - at the default size, the expanders are 5px further from the handle (3px in Indigo) and the expander click area changes from 16×12px to the icon box;
- in Indigo, the idle bar is thinner with an overridden
--ig-splitter-size.
A short line under ### General would make these easier to spot.
2. Indigo: changing --ig-size at run time
The idle bar reaches its new thickness only after the bar transition's 0.3s delay (transition: all 0.25s 0.3s in shared/indigo.scss). A run-time size change is rare, so I'm fine leaving it, but please add it to the Known limits so it doesn't get lost. The web components PR lists the same limit.
- 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.
|
Thanks, both done in d0eb77f.
|



Closes #18013
Description
igx-splitterfollows--ig-size. The bar, the drag handle and the expanders have a small, a medium and a large step, and the default is small, which is the size from before.igx-splitterincludessizable()and sets--component-size: var(--ig-size, <default-size>). The schema default is small.border-radiustoken, whose default is now 2px, 8px, 8px, scaled by--ig-radius-factor. A--border-radiusor--ig-splitter-border-radiusthat you set is one value and applies at every size, as before.sizetoken, so the documented--sizeand--ig-splitter-sizeoverrides still set the small size:10pxgives a 12px, 18px, 24px bar and a 10px, 12px, 14px handle. Before, it gave a 12px bar and a 10px handle.tan(atan2(<idle thickness>, <bar thickness>)), the ratio of the two lengths, so it follows the size, asizeoverride and the base font size. The bar hitbox follows the bar thickness.What stays the same:
--ig-sizekeeps its sizes: 6px bar, 4px handle with a 2px radius, 4px expanders. The one difference is the position of the expanders, 5px further from the handle (3px in Indigo), see Icon box.--sizeor--ig-splitter-sizerenders as before at the default size in Material, Fluent and Bootstrap. In Indigo the bar on hover is the same, and two things change: the idle bar is 1px where it was thicker (2px for--ig-splitter-size: 10px), and the bar hitbox is 4 times the bar thickness, 48px for that override where it was a fixed 24px.splitter-theme($border-radius: ...),--border-radiusand--ig-splitter-border-radius.Why the steps are not theme tokens: the bar, handle and expander steps are internal variables that add to the
sizetoken (bar +2/8/14px, handle +0/2/4px, expanders +0/1/2px). 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.Short bars:
clamp(0px, 37.5cqw - <expander box>, 48px), with the bar as a size container. The handle keeps 25% of the bar length and the expanders stay inside the bar. A 128px bar has a 32px handle with 30px margins at small and 24px at large.container-type: sizeon.igx-splitter-baradds layout and size containment to it. The bar has a set thickness and takes its length from the splitter, so its size does not come from its content.Removed: the internal
--splitter-sizecustom property onigx-splitter, which held the bar thickness as a number for the Indigo scale.Icon box, asked by design in the review:
::before, is that icon box as a square, centered on the triangle: 18px, 20px, 24px, and 14px, 16px, 24px in Indigo. Before, it was 4 by 3 times the triangle size in every theme (16px by 12px at small), which is what design measured as the container. The hitbox test fails without this change. The Indigo sizes follow from the Indigo space and have no spec.Known limits:
--ig-sizeat run time animates the idle bar with the 0.3s delay of the bar transition, so the idle bar does not have its new thickness until it ends.Motivation / Context
The splitter ignored
--ig-sizewhile the other components scale between small, medium and large. Design handoff and values are in #18013.Depends on IgniteUI/igniteui-theming#683 (for IgniteUI/igniteui-theming#682), which adds
default-sizeto the splitter schema and givesborder-radiusa step for each size. It is released inigniteui-theming@30.3.0.var-get()errors on a key the schema lacks, so the styles do not compile with30.2.0, and this PR bumps theigniteui-themingrange to^30.3.0in the rootpackage.jsonand in thedependenciesofprojects/igniteui-angular/package.json. The lockfile loses the nestedsass-embeddedcopies underigniteui-theming: 30.3.0 widens itssass-embeddedrange, so they dedupe to the root one. With30.3.0installed from the registry,lint:lib,build:lib,test:styles(40 tests),test:schematics(790 tests) and the 50 splitter tests pass.Related: IgniteUI/igniteui-webcomponents#2634.
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
Splitter, Theming
How Has This Been Tested?
splitter.component.spec.ts,IgxSplitter sizing, 7 tests, kept to the ones that guard behavior. The library tests load no global theme, so the test host declares the splitter tokens with the values of the schema.--ig-size.--ig-splitter-size.Against the styles of
master, 4 of the 5 fail; the collapsed-pane test passes there too. The small-size test fails there only on the handle radius: the test host declares the sizedborder-radiustoken, andmastersets no size flags onigx-splitter, so it resolves to 8px, which renders as the same pill on a 4px handle.npx ng test igniteui-angular --watch=false --include='**/splitter*.spec.ts': 51 tests pass, afternpm run build:styles:components.The compiled library theme (
themes/presets/igniteui-angular.scss) emits--size,--default-sizeand a sized--border-radiusonigx-splitter.npm run lint:lib,npm run build:lib,npm run test:stylesandnpm run test:schematicspass. The fulltest:libsuite and a manual check in the demo app were not run.Test Configuration:
masterScreenshots / Recordings
None.
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)