Skip to content

feat(splitter): follow --ig-size with small, medium and large bars - #2635

Open
desig9stein wants to merge 12 commits into
masterfrom
mpopov/feat-2634-splitter-support-small-medium-and
Open

desig9stein wants to merge 12 commits into
masterfrom
mpopov/feat-2634-splitter-support-small-medium-and

Conversation

@desig9stein

@desig9stein desig9stein commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

igc-splitter follows --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.

The splitter ignored --ig-size: splitter.common.scss read one fixed size token (4px) for the handle and the expanders and padded it by 1px on each side for the bar, and the host set no --component-size.

Changes

  • The host sets --component-size: var(--ig-size, <default-size>). The schema default is small.
  • The bar is 6px, 12px, 18px thick. The 1px bar padding is gone, and the bar centers the handle and the expanders itself.
  • The drag handle is 4px, 6px, 8px thick. Its radius is the border-radius token, whose default is now 2px, 8px, 8px, scaled by --ig-radius-factor. A --ig-splitter-border-radius that you set is one value and applies at every size, as before.
  • The expanders are 4px, 5px, 6px high and twice that wide.
  • The three steps add to the size token, so --ig-splitter-size still sets the small size: 10px gives a 12px, 18px, 24px bar and a 10px, 12px, 14px handle. Before, it gave a 12px bar and a 10px handle.
  • In Indigo the idle bar is 1px, 4px, 8px thick by size, as design asked in the review of feat(splitter): follow --ig-size with small, medium and large bars igniteui-angular#18017. The idle scale is tan(atan2(<idle thickness>, <bar thickness>)), the ratio of the two lengths, so it follows the size and a --ig-splitter-size override. Before, it was 1 / 6 at compile time, so an overridden size left an idle bar thicker than 1px.
Small Medium Large
Bar 6px 12px 18px
Drag handle 4px 6px 8px
Drag handle radius 2px 8px 8px
Expander height 4px 5px 6px

Why the steps are not theme tokens

The bar, handle and expander steps are internal variables that add to the size token (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. size stays the one token for the thickness: it sets the small size and every step moves with it.

Short bars

  • The 48px margins around the drag handle shrink when the bar is too short: clamp(0px, 37.5cqb - <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.
  • Before, the margins were a fixed 48px, so the handle shrank: 16px on a 128px bar on master.
  • A bar with room for everything, about 176px or more at small, keeps the 48px margins in every state: both expanders shown, a pane collapsed, the drag handle hidden. A shorter one has a longer handle and narrower margins, also at the default size. It is in the CHANGELOG under Fixed.
  • container-type: size on the bar adds 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.

Icon box

Design asked in the review of IgniteUI/igniteui-angular#18017 that the 48px start from the icon container of the expander, not from the arrow.

  • Each expander takes the icon box of the design along the bar: 18px, 20px, 24px, and 14px, 16px, 24px in Indigo. The triangle is 8px, 10px, 12px long, so it gets a margin of 5px, 5px, 6px on each side (3px, 3px, 6px in Indigo).
  • The drag handle is 48px from the box: 53px, 53px, 54px from the triangle (51px, 51px, 54px in Indigo). Before, it was 48px from the triangle.
  • The hitbox of an expander, a ::before, is that icon box as a square, centered on the triangle: 18px, 20px, 24px, and 14px, 16px, 24px in Indigo. Before, the expander had no hitbox and took the pointer on the triangle alone, 4px by 8px at small. It is the same box as the expander ::before of igx-splitter after feat(splitter): follow --ig-size with small, medium and large bars igniteui-angular#18017, which design asked for in the review.
  • This changes the default size too: at small each expander is 5px further from the handle than on master, 3px in Indigo. It is in the CHANGELOG.
  • The space is a private step, like the bar, handle and expander steps. The expander stays one element and the parts are the same.

Review fixes

  • A change of --ig-size recomputes the pane constraints. The resize observer also observes the bar, whose thickness changes without a host resize. In a 500px splitter with two 245px minimums, a switch from small to large drops both minimums, as a container too small for them does. Before, they stayed applied and the panes overflowed by 8px.
  • The space for the panes counts the full thickness of the bar: its computed layout size, which no transform changes, at the scale of the measured container. The value keeps its fraction and follows a scaled ancestor, and a rotated ancestor does not inflate it. Before, it was the bounding box, which in Indigo is the thickness the idle bar is scaled to, so two minimums that filled the splitter overflowed it. master has the same error with its 6px bar; a larger size made it up to 17px. It is in the CHANGELOG under Fixed.
  • Without a drag handle (hide-drag-handle or disable-resize) the gap between the two expander boxes is clamp(0px, 100cqb - 2 * <expander box>, 48px): 48px when the bar has room, less on a shorter bar. Before, it was a fixed 48px, so on a 68px bar at large the expanders overflowed by 4px. The rule moved from splitter.base.scss to the orientation loop in splitter.common.scss, next to the handle margins.
  • The sizing tests for medium and large, the short bar and the Indigo idle bar run in both orientations.

The comment about the igniteui-theming version is fixed by the range bump to ^30.3.0, see Depends on.

What stays the same

  • A splitter without --ig-size keeps 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.
  • Parts, properties and events. No CEM or public-api.json change.
  • Every way of setting the handle radius: splitter-theme($border-radius: ...) and --ig-splitter-border-radius.
  • The drag handle is 25% of the bar length at every size.

Depends on

IgniteUI/igniteui-theming#683 (for IgniteUI/igniteui-theming#682) adds default-size and the sized border-radius default to the schema. It is released in igniteui-theming@30.3.0. var-get() errors on a key the schema lacks, so the styles do not compile with 30.2.0, and this PR bumps the igniteui-theming range to ^30.3.0. The lockfile loses the nested sass-embedded copies under igniteui-theming: 30.3.0 widens its sass-embedded range, so they dedupe to the root one. With 30.3.0 installed from the registry, npm run lint, npm run check and npm test pass: 7034 passed, 0 failed, 2 skipped.

Known limit

  • The handoff draws the expanders as arrow icons (18/20/24px, Indigo 14/16/24px). They stay CSS triangles here, 4/5/6px in every theme, so small does not change.
  • The handoff measures the gap as 48/48/46px from the icon box. Here it is 48px from the box at every size when the bar has room.
  • In Indigo, a change of --ig-size at run time animates the idle scale with the 0.5s delay of the bar transition, so the idle bar does not have its new thickness until it ends.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)

Related Issues

Closes #2634

Related: IgniteUI/igniteui-angular#18013

Testing

src/components/splitter/splitter.spec.ts, Sizing, 16 tests:

  • renders the small size without --ig-size.
  • sizes the bar, the drag handle and the expanders at medium and large, in both orientations.
  • adds each step to an overridden --ig-splitter-size.
  • keeps 48px between the drag handle and the icon box of each expander, at every size.
  • uses the smaller icon box of indigo for the gaps.
  • sizes the hitbox of each expander to the icon box and centers it on the triangle, in both orientations. It fails without the hitbox.
  • keeps the 48px margins around the drag handle with a collapsed pane.
  • keeps the drag handle at 25% of a short bar and narrows the gaps, at every size and in both orientations.
  • keeps the expander boxes 48px apart without a drag handle and inside a bar too short for it.
  • drops the minimum sizes that no longer fit when the size makes the bar thicker.
  • keeps a 1px, 4px and 8px idle bar by size, also with an overridden size, in indigo.
  • takes the full bar thickness from the panes while the bar is idle in indigo.
  • counts a fractional bar thickness against the minimum sizes.
  • measures the bar in the coordinates of a scaled ancestor.
  • keeps the minimum sizes that fit beside the idle bar under a rotated ancestor in indigo.
  • shows the full bar thickness on hover at every size in indigo.

Against the styles of master, 5 of the 7 tests of the first commit fail (medium and large, the size override, the short bar, the Indigo idle bar and hover). The small default and the collapsed pane pass there too: they pin what stays the same. The three tests of the review fixes (the expanders without a drag handle, the dropped minimums, the pane space in Indigo) fail without their fix, checked against the first commit of this PR. The fractional thickness and the scaled ancestor tests fail against the second commit, which read offsetWidth. The rotated ancestor test fails against the third commit, which divided the bounding box of the bar by its scale.

npm run lint, npm run build:styles, npm run check and npm test pass in Chromium: 7034 passed, 0 failed, 2 skipped.

The splitter spec in the other browsers: WebKit 164 of 164. Firefox 129 of 164; all 16 Sizing tests pass there, and the 35 failures are NotFoundError: Element.setPointerCapture: Invalid pointer id in the drag tests, which this change does not touch.

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally
  • I have updated documentation if needed
  • I have added a CHANGELOG.md entry under [Unreleased]
  • I have read the contributing guidelines, including the accessibility, dependency and security rules

@desig9stein
desig9stein force-pushed the mpopov/feat-2634-splitter-support-small-medium-and branch 2 times, most recently from 1acbfc0 to 3880ccd Compare November 19, 2026 15:05
@desig9stein
desig9stein marked this pull request as ready for review November 19, 2026 15:14
Copilot AI balanced review requested due to automatic review settings November 19, 2026 15:14

Copilot AI left a comment

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.

🟡 Changes recommended

The locked theming dependency lacks the required schema key, breaking clean builds, and splitter sizing can leave constraints stale or cause overflow.

5 open issues
What changed in this PR

Adds --ig-size support to the splitter, aligning it with the library’s small, medium and large sizing while keeping small as the default.

Changes:

  • Introduces size-dependent bar, drag-handle and expander dimensions.
  • Adjusts short-bar spacing and makes Indigo’s idle scale follow the current thickness.
  • Adds seven sizing tests and documents the behavior.
File Description
src/​components/​splitter/​themes/​splitter.base.scss Centers controls and establishes size containment for responsive spacing.
src/​components/​splitter/​themes/​shared/​splitter.indigo.scss Calculates the idle scale from the current bar thickness.
src/​components/​splitter/​themes/​shared/​splitter.common.scss Adds size steps and adaptive drag-handle margins.
src/​components/​splitter/​splitter.spec.ts Tests dimensions, overrides, spacing and Indigo states.
src/​components/​splitter/​spec.md Documents sizing behavior and test scenarios.
CHANGELOG.md Records size support and the short-bar spacing fix.

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.
…th the bar size

- A change of --ig-size recomputes the pane constraints: the bar is observed for resize, so a thicker bar drops the minimum sizes that no longer fit.
- The space for the panes counts the layout thickness of the bar. In Indigo the idle bar is scaled to 1px, and its minimum sizes no longer overflow the splitter.
- Without a drag handle the gap between the expanders is 48px at most and shrinks to what a short bar leaves, so the expanders stay inside it.
- The sizing tests run in both orientations.

Refs #2634.
@desig9stein
desig9stein force-pushed the mpopov/feat-2634-splitter-support-small-medium-and branch from 1286af1 to 816c138 Compare November 19, 2026 18:18
@desig9stein
desig9stein requested a balanced review from Copilot November 20, 2026 08:35

Copilot AI left a comment

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.

🟡 Changes recommended

The locked theming dependency lacks the required schema key, breaking clean builds and tests; drag resizing and bar measurements also have unresolved sizing defects.

6 open issues
2 resolved since last review

Review effort: Balanced

Comment thread src/components/splitter/splitter.ts Resolved
Comment thread src/components/splitter/splitter.ts Resolved
Comment thread src/components/splitter/splitter.ts Resolved
…tes of the container

- The bar thickness is its bounding box divided by the scale a theme sets on the bar, so it keeps its fraction and follows a scaled ancestor like the container does.
- A fractional thickness counts in full against the minimum sizes.

Refs #2634.

Copilot AI left a comment

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.

🟡 Changes recommended

The splitter bar can collapse in auto-height containers, discard valid minimum constraints under transforms, and lose its usable handle when controls do not fit.

2 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Preserve a usable handle when controls cannot fit

src/​components/​splitter/​themes/​shared/​splitter.common.scss:118

At large size, a 20px bar needs 24px for its two expanders before any handle or gap, so zero margins still let the buttons overflow and shrink the handle to zero. Define a fallback when the controls themselves cannot fit, such as reducing or hiding them while preserving a usable handle. The hidden-handle gap at line 95 needs the same fallback.

Medium severity Size containment can collapse the bar in auto-height containers

src/​components/​splitter/​themes/​splitter.base.scss:48

Size containment removes the bar's intrinsic contribution in both axes. If the splitter is in an auto-height container and its panes are empty or very short, the percentage heights are indefinite, so the bar can now collapse to zero height; previously its controls and margins gave it a usable intrinsic height. Please preserve an intrinsic length fallback, or otherwise avoid size containment when the splitter's length is content-sized.

6 resolved since last review

Review effort: Balanced

Comment thread src/components/splitter/splitter.ts Resolved
Comment thread src/components/splitter/splitter.ts Resolved
- The bar thickness is its computed layout size at the scale of the container, so a rotated ancestor does not inflate it and the scale of a theme does not shrink it.

Refs #2634.
- The idle Indigo bar is 1px, 4px or 8px thick at small, medium and large. Before, it was 1px at every size.

Refs #2634.
- 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.
- Without a drag handle the two boxes are 48px apart.

Refs #2634.
@sbayreva

Copy link
Copy Markdown

All Themese

The size of the small container around the expander is different from the one in Angular. This is relevant for all themes. For example:

Bootstrap Large size in web components:
Screenshot 2026-11-23 at 15 38 20

Bootstrap Large size in Angular:

Screenshot 2026-11-23 at 15 39 41

…chema

- The splitter styles read `default-size` and the sized `border-radius` from the schema, which `igniteui-theming` ships from 30.3.0.
- 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 the arrow alone, 4px by 8px at small.
- The hitbox matches the one of igx-splitter in igniteui-angular.

@simeonoff simeonoff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, this lines up with IgniteUI/igniteui-angular#18017 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 match. The extras that only this PR has fit the web components splitter: the expander gap without a drag handle, recomputing the pane minimums on a size change, and measuring the bar from its layout thickness. Three small things:

1. CHANGELOG: list the behaviour changes under ### Changed
The entry is only under Added, but it includes changes that apps get without opting in:

  • an app that already sets --ig-size to medium or large gets a thicker bar;
  • at the default size, the expanders are 5px further from the handle (3px in Indigo) and have a larger pointer area.

A short line under ### Changed would make these easier to spot (CONTRIBUTING.md asks for the Keep a Changelog categories).

2. Indigo: changing --ig-size at run time
The idle bar reaches its new thickness only after the bar transition's 0.5s delay. The PR already lists this as a known limit. A run-time size change is rare, so I'm fine leaving it, but please add it to the Limitations section of spec.md so it doesn't get lost.

3. Nit: splitter.ts:1000
Number.parseFloat(value) || 0 repeats asNumber() from #internals/utils/math.js, which this file already uses.

…litter-support-small-medium-and

# Conflicts:
#	CHANGELOG.md
- CHANGELOG: the thicker bar for an app that already sets `--ig-size` and the new expander gap and pointer area are under Changed; Added keeps the new sizes.
- spec.md: Assumptions and limitations lists the 0.5s delay before the Indigo idle bar takes a run-time `--ig-size` change.
- The bar thickness sums its box values with `asNumber()`.
@desig9stein

Copy link
Copy Markdown
Contributor Author

Thanks, all three done in ab0ab74. The branch also merges master (8778348), which fixes the CHANGELOG conflict with the QR code entries.

  1. CHANGELOG: ### Changed has a splitter entry for the thicker bar for an app that already sets --ig-size to medium or large, and for the expander gap and larger pointer area. Added keeps the new sizes.
  2. spec.md had no Limitations section, so it now has "Assumptions and limitations", as in the other specs. It lists the 0.5s delay before the Indigo idle bar takes a run-time --ig-size change.
  3. The bar thickness sums its box values with asNumber().

lint, check, build:styles and test pass: 7277 passed, 0 failed, 2 skipped.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Splitter: support small, medium and large sizes through --ig-size

5 participants