Skip to content

feat(splitter): add default-size and small, medium and large steps to the schema - #683

Merged
simeonoff merged 3 commits into
masterfrom
mpopov/feat-682-splitter-add-default-size-and
Nov 23, 2026
Merged

simeonoff merged 3 commits into
masterfrom
mpopov/feat-682-splitter-add-default-size-and

Conversation

@desig9stein

@desig9stein desig9stein commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #682.

The splitter schema gets a default size and a per-size handle radius, so igc-splitter and igx-splitter can follow --ig-size (IgniteUI/igniteui-webcomponents#2634, IgniteUI/igniteui-angular#18013).

Changes

Schema ($light-splitter, inherited by the four themes, light and dark):

  • The splitter defaults to small: 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 as sizable over three border-radius instructions, with small as the default step.
  • size stays rem(4px).

A passed $border-radius, or --ig-splitter-border-radius set in CSS, is one value, so it applies at every size, as before.

Sass:

  • sizable() takes $default (1, 2 or 3). A component without the sizable() mixin has no --is-* flags, so it gets the default step. Without $default it gets the largest step, as before, and the output of every other component is the same. Any other value is an error.
  • A map argument of a sizable instruction is resolved as an instruction of its own, so a schema can write sizable over border-radius. A sizable instruction of plain values resolves as before.
border-radius: (
    sizable: (
        (border-radius: rem(2px)),
        (border-radius: rem(8px)),
        (border-radius: rem(8px)),
        1,
    ),
),
/* map.get(splitter-theme(), 'border-radius') */
max(
    var(--is-large, 0) * max(clamp(0rem, calc(var(--ig-radius-factor, 1) * 0.5rem), 0.5rem), -1 * clamp(...)),
    var(--is-medium, 0) * max(clamp(0rem, calc(var(--ig-radius-factor, 1) * 0.5rem), 0.5rem), -1 * clamp(...)),
    var(--is-small, 1) * max(clamp(0rem, calc(var(--ig-radius-factor, 1) * 0.125rem), 0.125rem), -1 * clamp(...))
)

Why there are no tokens for the bar, the handle and the expanders

The components add the per-size steps to size themselves (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. size stays 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

  • Released igniteui-angular (themes/_base.scss) and igniteui-webcomponents (splitter.indigo.scss) read size as a number at compile time. It keeps its value, so they compile as before.
  • They read border-radius with var(). Released igx-splitter does not include the sizable() mixin, so it resolves the radius to the default step, 2px, as before. Released Web Components sets no --component-size on the splitter, so it resolves to the small step, 2px, too.
  • avatar-theme() and chip-theme() return the same size as on master, and the compiled tests/e2e/theme.css is identical to the one of master.
  • splitter-theme() keeps its parameters.

Known limit

  • The issue asked for the expander icon size as a schema value, with smaller Indigo values (14/16/24px against 18/20/24px). That part is dropped on purpose: the components draw the expanders as CSS triangles, not icons, with the same steps in every theme (4px, 5px, 6px), so the schema has no expander value.
  • The radius of 2px, 8px, 8px is applied to all four themes. Design has not confirmed it for Fluent, Bootstrap and Indigo; the question is open in Splitter: add default-size and small, medium and large steps to the schema #682.
  • _abs() wraps each clamp() of the radius as max(clamp(…), -1 * clamp(…)). It only adds to the output size and is left for a follow-up.

Release notes

  • The splitter has default-size: 1, and its default border-radius is 2px, 8px, 8px by size.
  • The default output of tokens() no longer has --ig-splitter-border-radius at the root, because the global mode skips sizable values. The component falls back to its own default, and a --ig-splitter-border-radius that you set still applies at every size. CSS that reads the token without setting it gets no value.
  • sizable() has a new optional $default parameter.

Tests

packages/theming/tests/_themes.spec.scss:

Sizing, 4 new tests:

  • falls back to every step without a default size.
  • falls back to the step of the default size only, for 1, 2 and 3.
  • resolves the instruction maps inside a sizable instruction.
  • resolves a sizable instruction of plain values as before.

Splitter, 4 tests:

  • defaults to small in every theme.
  • keeps the size token a plain 4px number in every theme.
  • rounds the handle by 2px at small and 8px at medium and large, scaled by the radius factor, in every theme. The expected value is built from sizable(border-radius(...), ..., 1).
  • applies a passed border-radius at every size.

npm run lint, npm run build and npm test pass: 42 files, 1543 tests (1535 on master).

Notes

@desig9stein
desig9stein marked this pull request as draft November 19, 2026 13:57
desig9stein added a commit to IgniteUI/igniteui-webcomponents that referenced this pull request Nov 19, 2026
- 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.
@desig9stein
desig9stein force-pushed the mpopov/feat-682-splitter-add-default-size-and branch from 064fd87 to 1d35b26 Compare November 19, 2026 14:13
desig9stein added a commit to IgniteUI/igniteui-angular that referenced this pull request Nov 19, 2026
- 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.
desig9stein added a commit to IgniteUI/igniteui-angular that referenced this pull request Nov 19, 2026
- 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.
@desig9stein
desig9stein force-pushed the mpopov/feat-682-splitter-add-default-size-and branch from 1d35b26 to 16acf92 Compare November 19, 2026 15:04
desig9stein added a commit to IgniteUI/igniteui-webcomponents that referenced this pull request Nov 19, 2026
- 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.
@desig9stein
desig9stein marked this pull request as ready for review November 19, 2026 15:14
@desig9stein
desig9stein requested a balanced review from Copilot November 19, 2026 15:16

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.

🟢 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 size at rem(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

desig9stein added a commit to IgniteUI/igniteui-webcomponents that referenced this pull request Nov 19, 2026
- 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.
@desig9stein desig9stein added ❌ status: awaiting-test PRs awaiting manual verification schemas splitter labels Nov 20, 2026
@simeonoff

Copy link
Copy Markdown
Member

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 --ig-size

sizable() falls back to 1 for every --is-*, so without the sizable() mixin on the host, max() picks the large step. The released igx-splitter doesn't include the mixin, and both Angular and Web Components depend on igniteui-theming: ^30.2.0. A minor release with this PR turns the handle radius from 2px to 8px for existing Angular apps (and for Web Components apps that emit splitter themes themselves) before igniteui-angular#18017 / igniteui-webcomponents#2635 ship.

Fix: give sizable() an optional $default (1, 2 or 3). When it's set, the default step falls back to 1 and the other two to 0:

@function sizable($sm, $md: $sm, $lg: $md, $default: null) {
    // ...
    $fallbacks: (1, 1, 1);

    @if $default {
        $fallbacks: list.set-nth((0, 0, 0), $default, 1);
    }

    @return max(
        calc(var(--is-large, #{list.nth($fallbacks, 3)}) * #{$lg}),
        calc(var(--is-medium, #{list.nth($fallbacks, 2)}) * #{$md}),
        calc(var(--is-small, #{list.nth($fallbacks, 1)}) * #{$sm})
    );
}

With the mixin present all three --is-* are set, so the new components behave the same. Without it, the splitter gets the small step (2px). null keeps the current output, so avatar, chip and the rest don't change. The splitter passes 1, which matches its default-size.

2. Let resolve-value resolve nested instructions instead of hand-writing border-radius()

The clamp(...) literals exist because resolve-value calls one function per value, so sizable can't wrap border-radius. They copy the function's output, so they drift as soon as border-radius() changes, and the spec repeats them. Have the sizable branch resolve map arguments first:

@if $fn == 'sizable' {
    $steps: ();

    @each $arg in $args {
        @if meta.type-of($arg) == 'map' {
            $arg: resolve-value($arg);
        }

        $steps: list.append($steps, $arg, $separator: comma);
    }

    $result: sizable($steps...);
}

The schema then becomes:

border-radius: (
    sizable: (
        (border-radius: rem(2px)),
        (border-radius: rem(8px)),
        (border-radius: rem(8px)),
        1,
    ),
),

The change is additive: existing sizable: (a, b, c) lists have no map arguments and resolve as before. I prototyped both changes locally. The splitter emits max(var(--is-large, 0) * clamp(...0.5rem...), var(--is-medium, 0) * ..., var(--is-small, 1) * clamp(...0.125rem...)), and avatar's output is identical to master.

The spec should build the expected value from sizable(border-radius(rem(2px)), border-radius(rem(8px)), border-radius(rem(8px)), 1) instead of the literals. Add a sizable() test for $default (fallbacks with and without it) and one for a sizable instruction with map arguments.

Optional: _abs() still wraps each clamp() as max(clamp(…), -1 * clamp(…)), because anything that isn't a plain number gets wrapped. It's only output size, so it can be a follow-up.

3. The root --ig-splitter-border-radius is gone from tokens()

_tokens-global skips sizable values, so the default tokens() output no longer has --ig-splitter-border-radius. Overriding it still works at every size, and the component falls back to its own default, so the practical impact is CSS that reads the token without setting it. That can't be avoided with a sizable default: a root value would always win over the scoped fallback. It needs a line in the release notes, since #682 says the default output stays the same.

4. Schema scope vs. #682

#682 asks for the bar, handle and expander steps (with Indigo's 14/16/24px expander) in the schema. The component PRs deliberately keep them as component-internal additions to size, which I think is the better call. Please update #682 so it matches, and note the unanswered design questions: the branch applies Material's 2/8/8px radius to Fluent, Bootstrap and Indigo.

SassDoc

  • Schema border-radius: [(rem(2px), rem(8px), rem(8px))] reads like the repo's (value, min, max) notation (see input-group, or this schema's old (2px, 0, 2px)). Spell it out: @prop {Map} border-radius [sizable: (2px, 8px, 8px)] - The border radius of the drag handle at small, medium and large, scaled by the radius factor.
  • Schema size and $size: "the arrow expander's" has a misused apostrophe, and "the components add a step" only holds once the component PRs land. Suggested wording: The drag handle thickness and the expander height at the small size. The bar and the medium and large sizes derive from it.
  • $border-radius: typed {List} but documented as a plain value. Use {Number}, or {Number|List} to stay close to chip.
  • sizable(): document @param {Number} $default [null] - The size (1, 2 or 3) used when the component doesn't include the sizable() mixin. When null, that component gets the largest step.
  • resolve-value(): add an @example showing a sizable instruction with nested instruction maps.

…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.
@desig9stein

Copy link
Copy Markdown
Contributor Author

All applied in fbc4da3.

  1. sizable() takes $default. The splitter passes 1, so without the mixin it resolves to 2px. A value other than 1, 2 or 3 is an error. Avatar and chip return the same size as on master, and the compiled tests/e2e/theme.css is identical.
  2. The sizable branch of resolve-value resolves map arguments first, through a small private _resolve-args(); inlined it tripped max-nesting-depth. The schema is sizable over three border-radius instructions with 1, and the spec builds its expected value from sizable(border-radius(...), ..., 1). New tests: the fallbacks with and without $default, a sizable instruction with map arguments, and one with plain values. _abs() is left for a follow-up.
  3. Added to the release notes in the description.
  4. Splitter: add default-size and small, medium and large steps to the schema #682 is updated: the steps stay in the components, and the radius question for Fluent, Bootstrap and Indigo is listed as open.

SassDoc: all five applied. I also added $default to the sizable() page of the MCP docs.

@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.

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.

@simeonoff
simeonoff added this pull request to the merge queue Nov 23, 2026
Merged via the queue into master with commit 93c97a1 Nov 23, 2026
5 checks passed
@simeonoff
simeonoff deleted the mpopov/feat-682-splitter-add-default-size-and branch November 23, 2026 09:38
simeonoff pushed a commit to IgniteUI/igniteui-angular that referenced this pull request Nov 25, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

schemas splitter ❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Splitter: add default-size and small, medium and large steps to the schema

3 participants