From d9b64ebb5ef4949f8aef437fe78803261b8c5c92 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Thu, 19 Nov 2026 15:57:00 +0200 Subject: [PATCH 1/7] 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. --- CHANGELOG.md | 10 ++ projects/igniteui-angular/splitter/README.md | 13 ++ .../src/splitter/splitter.component.spec.ts | 167 +++++++++++++++++- .../splitter/src/splitter/themes/_base.scss | 87 +++++---- .../src/splitter/themes/shared/indigo.scss | 10 +- 5 files changed, 247 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec9fc3f52c4..5fcdaf9ae36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,18 @@ All notable changes for each version of this project will be documented in this ## 22.3.1 +### New Functionality + +- `IgxSplitterComponent` + - The splitter follows `--ig-size`. The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px with a 2px, 8px or 8px radius, and the expanders grow with them. The default is small, which is the size from before, so a splitter without `--ig-size` looks the same. `--size` and `--ig-splitter-size` still set the small size, and the medium and large steps add to it. A `--border-radius` or `--ig-splitter-border-radius` that you set applies at every size. In the Indigo theme the idle bar is 1px thick also with an overridden size, where it was thicker before (2px for `--ig-splitter-size: 10px`), and the area around the bar that takes the pointer grows with the bar. Previously the splitter had one size, so an app that sets `--ig-size` to medium or large on the splitter or on an ancestor now gets a thicker bar (#18013). + ```html + ... + ``` + ### Bug Fixes +- `IgxSplitterComponent` + - On a bar too short for the drag handle, the two expanders and the 48px gaps between them, the drag handle keeps 25% of the bar length and the gaps get narrower. Previously the gaps stayed 48px, so the handle shrank and the expanders touched the ends of the bar (#18013). - `IgxGridComponent`, `IgxTreeGridComponent`, `IgxHierarchicalGridComponent` - Replacing the data and the columns of a percentage-height grid no longer runs a redundant sizing pass (#17792). - `IgxHierarchicalGridComponent` diff --git a/projects/igniteui-angular/splitter/README.md b/projects/igniteui-angular/splitter/README.md index e95970aaee3..4781c70be02 100644 --- a/projects/igniteui-angular/splitter/README.md +++ b/projects/igniteui-angular/splitter/README.md @@ -59,6 +59,19 @@ export class SplitLayoutComponent { - **Non-collapsible bars** – set `nonCollapsible` on the splitter to hide the expanders and disable collapsing with `Ctrl` + arrow keys when panes must stay visible. - **Keyboard support** – users can resize with the arrow keys (by 10px per key press, emitting the same resize events as a drag); combine with `Ctrl` to collapse or expand panes. A splitter bar stays in the tab order unless it can neither resize nor collapse its panes. - **Drag constraints** – `minSize` and `maxSize` (px or % of the splitter size) enforce boundaries while resizing, ensuring important content stays visible. +- **Sizing** – the splitter has no size input. It follows `--ig-size`, set on the splitter or on an ancestor, and defaults to small. + + ```html + ... + ``` + + | Size | Bar thickness | Drag handle thickness | Drag handle radius | Expander height | + | --- | --- | --- | --- | --- | + | small | 6px | 4px | 2px | 4px | + | medium | 12px | 6px | 8px | 5px | + | large | 18px | 8px | 8px | 6px | + + The steps add to the `size` theme token (4px), so `--ig-splitter-size: 10px` makes the bar 12px, 18px and 24px and the drag handle 10px, 12px and 14px. ## API Reference diff --git a/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts b/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts index faead79f9b9..fcad0db01a2 100644 --- a/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts +++ b/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts @@ -1,5 +1,5 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { Component, ViewChild, DebugElement, ChangeDetectionStrategy, provideZonelessChangeDetection } from '@angular/core'; +import { Component, ViewChild, DebugElement, ChangeDetectionStrategy, ViewEncapsulation, provideZonelessChangeDetection } from '@angular/core'; import { SplitterType, IgxSplitterComponent, ISplitterBarResizeEventArgs } from './splitter.component'; import { By } from '@angular/platform-browser'; import { UIInteractions, wait } from '../../../test-utils/ui-interactions.spec'; @@ -925,6 +925,139 @@ describe('IgxSplitter resizing with minSize and browser window is shrinked', () }); }); +describe('IgxSplitter sizing', () => { + const steps = [ + { size: 'small', value: '1', bar: 6, handle: 4, expander: 4, radius: 2 }, + { size: 'medium', value: '2', bar: 12, handle: 6, expander: 5, radius: 8 }, + { size: 'large', value: '3', bar: 18, handle: 8, expander: 6, radius: 8 } + ]; + let fixture: ComponentFixture; + + const measure = () => { + const host: HTMLElement = fixture.nativeElement; + // Finishes a bar transition that is still running. + document.getAnimations().forEach(animation => animation.finish()); + // The bar of a horizontal splitter is a vertical line, so its thickness is its width. + const extent = fixture.componentInstance.type === SplitterType.Horizontal ? 'width' : 'height'; + const length = extent === 'width' ? 'height' : 'width'; + const rect = (selector: string) => host.querySelector(selector).getBoundingClientRect(); + const bar = rect(SPLITTERBAR_DIV_CLASS); + const handle = rect('.igx-splitter-bar__handle'); + const expander = rect('.igx-splitter-bar__expander--start'); + + return { + bar: bar[extent], + barLength: bar[length], + handle: handle[extent], + handleLength: handle[length], + handleRadius: getComputedStyle(host.querySelector('.igx-splitter-bar__handle')).borderRadius, + expander: expander[extent], + expanderBase: expander[length] + }; + }; + + beforeEach(async () => { + await TestBed.configureTestingModule({ imports: [SplitterSizingComponent] }).compileComponents(); + fixture = TestBed.createComponent(SplitterSizingComponent); + fixture.detectChanges(); + }); + + it('should render the small size without --ig-size', () => { + const { bar, handle, handleRadius, expander, expanderBase } = measure(); + + expect(bar).toBe(6); + expect(handle).toBe(4); + expect(handleRadius).toBe('2px'); + expect(expander).toBe(4); + expect(expanderBase).toBe(8); + }); + + it('should size the bar, the handle and the expanders at medium and large', () => { + for (const step of steps.slice(1)) { + fixture.componentInstance.size = step.value; + fixture.detectChanges(); + + const { bar, handle, handleRadius, expander, expanderBase } = measure(); + + expect(bar, step.size).toBe(step.bar); + expect(handle, step.size).toBe(step.handle); + expect(handleRadius, step.size).toBe(`${step.radius}px`); + expect(expander, step.size).toBe(step.expander); + expect(expanderBase, step.size).toBe(step.expander * 2); + } + }); + + it('should add each step to an overridden --ig-splitter-size', () => { + fixture.componentInstance.baseSize = '10px'; + + for (const step of steps) { + fixture.componentInstance.size = step.value; + fixture.detectChanges(); + + const { bar, handle, expander } = measure(); + + // 6px more than the default 4px size at every step. + expect(bar, step.size).toBe(step.bar + 6); + expect(handle, step.size).toBe(step.handle + 6); + expect(expander, step.size).toBe(step.expander + 6); + } + }); + + const gaps = () => { + const host: HTMLElement = fixture.nativeElement; + document.getAnimations().forEach(animation => animation.finish()); + const rect = (selector: string) => host.querySelector(selector).getBoundingClientRect(); + const bar = rect(SPLITTERBAR_DIV_CLASS); + const handle = rect('.igx-splitter-bar__handle'); + const start = rect('.igx-splitter-bar__expander--start'); + const end = rect('.igx-splitter-bar__expander--end'); + + return { + handleGaps: [handle.top - start.bottom, end.top - handle.bottom], + inside: start.top >= bar.top && end.bottom <= bar.bottom + }; + }; + + it('should keep the handle 48px from the bar content edge with a collapsed pane', () => { + const panes = fixture.componentInstance.splitter.panes.toArray(); + const handleTop = () => { + const host: HTMLElement = fixture.nativeElement; + document.getAnimations().forEach(animation => animation.finish()); + return host.querySelector('.igx-splitter-bar__handle').getBoundingClientRect().top + - host.querySelector(SPLITTERBAR_DIV_CLASS).getBoundingClientRect().top; + }; + // The handle, its two 48px margins and the one expander that is left, centered in the 400px bar. + const groupStart = (400 - (100 + 96 + 8)) / 2; + + panes[0].toggle(); + fixture.detectChanges(); + expect(handleTop()).toBe(groupStart + 48); + + panes[0].toggle(); + panes[1].toggle(); + fixture.detectChanges(); + expect(handleTop()).toBe(groupStart + 8 + 48); + }); + + it('should keep the handle at 25% of a short bar and narrow the gaps at every size', () => { + fixture.componentInstance.height = '128px'; + + for (const step of steps) { + fixture.componentInstance.size = step.value; + fixture.detectChanges(); + + const { handleLength } = measure(); + const { handleGaps, inside } = gaps(); + // What the bar leaves after the handle and the two expanders, halved. + const gap = (128 - 32 - step.expander * 4) / 2; + + expect(handleLength, step.size).toBe(32); + expect(handleGaps, step.size).toEqual([gap, gap]); + expect(inside, step.size).toBe(true); + } + }); +}); + describe('Zoneless IgxSplitter', () => { let fixture: ComponentFixture; let splitter: IgxSplitterComponent; @@ -1075,3 +1208,35 @@ export class SplitterCollapsedPaneComponent extends SplitterTestComponent { export class SplitterForOfPanesComponent extends SplitterTestComponent { public numbers = [1, 2, 3]; } + +@Component({ + template: ` +
+ + Pane 1 + Pane 2 + +
+ `, + // Mirrors the splitter tokens of igniteui-theming that the styles read, which a global theme emits on igx-splitter. + styles: [` + igx-splitter { + --default-size: 1; + --size: var(--ig-splitter-size, 4px); + --border-radius: var(--ig-splitter-border-radius, max(calc(var(--is-large, 1) * 8px), calc(var(--is-medium, 1) * 8px), calc(var(--is-small, 1) * 2px))); + --expander-color: gray; + } + `], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.Eager, + imports: [IgxSplitterComponent, IgxSplitterPaneComponent] +}) +export class SplitterSizingComponent { + public type = SplitterType.Horizontal; + public size: string = null; + public baseSize: string = null; + + @ViewChild(IgxSplitterComponent, { static: true }) + public splitter: IgxSplitterComponent; + public height = '400px'; +} diff --git a/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss b/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss index d69664278b4..d068d8bf53d 100644 --- a/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss +++ b/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss @@ -1,5 +1,4 @@ /* stylelint-disable max-nesting-depth */ -@use 'sass:map'; @use 'sass:string'; @use 'igniteui-theming/sass/animations' as *; @use 'igniteui-theming/sass/bem' as *; @@ -13,14 +12,24 @@ $theme: digest-schema($light-splitter); @include layer(base) { $splitter-color: var-get($theme, 'bar-color'); - $splitter-size: var-get($theme, 'size'); + $size: var-get($theme, 'size'); + $bar-size: var(--_bar-size); + $handle-size: var(--_handle-size); + $expander-size: var(--_expander-size); $hitbox-size: rem(4px); $debug-hitbox: false; $hitbox-debug-color: rgba(coral, 0.24); @include b(igx-splitter) { - //splitter-size (convert rem to px) + padding - --splitter-size: calc(#{unitless(map.get($theme, 'size'))} * (var(--ig-base-font-size, 16px) / 1px) + 2); + @include sizable(); + + --component-size: var(--ig-size, #{var-get($theme, 'default-size')}); + + // The steps are not theme tokens, so the handle can't be set thicker than the bar. + // Mirrored by the :host block of igc-splitter in igniteui-webcomponents. + --_bar-size: #{sizable(calc(#{$size} + #{rem(2px)}), calc(#{$size} + #{rem(8px)}), calc(#{$size} + #{rem(14px)}))}; + --_handle-size: #{sizable($size, calc(#{$size} + #{rem(2px)}), calc(#{$size} + #{rem(4px)}))}; + --_expander-size: #{sizable($size, calc(#{$size} + #{rem(1px)}), calc(#{$size} + #{rem(2px)}))}; &[aria-orientation='horizontal'] { [dir='rtl'] & { @@ -46,7 +55,10 @@ $theme: digest-schema($light-splitter); justify-content: center; align-items: center; background: $splitter-color; - padding-block: rem(1px); + height: $bar-size; + + // Gives the drag handle the bar length, as container query units. + container-type: size; z-index: 99; opacity: 0.68; transition: opacity 0.15s $ease-out-quad !important; @@ -100,22 +112,25 @@ $theme: digest-schema($light-splitter); @include e(handle, $m: horizontal) { width: 25%; - height: $splitter-size; - margin: 0 rem(48px); + height: $handle-size; + + // The room for one margin when the bar is too short for 48px: half of what the 25% handle + // leaves, less one expander. 1cqw is 1% of the bar length, with the bar as the size container. + margin: 0 clamp(0px, calc((100cqw - 25cqw) / 2 - 2 * #{$expander-size}), #{rem(48px)}); } @include e(handle, $m: vertical) { - width: $splitter-size; + width: $handle-size; height: 25%; - margin: rem(48px) 0; + margin: clamp(0px, calc((100cqh - 25cqh) / 2 - 2 * #{$expander-size}), #{rem(48px)}) 0; } @include e(expander) { position: relative; width: 0; height: 0; - border-inline-end: $splitter-size solid transparent; - border-inline-start: $splitter-size solid transparent; + border-inline-end: $expander-size solid transparent; + border-inline-start: $expander-size solid transparent; cursor: pointer; opacity: 0; transition: opacity 0.25s 0.5s ease; @@ -130,26 +145,26 @@ $theme: digest-schema($light-splitter); } @include e(expander, $m: 'start') { - border-block-end: $splitter-size solid + border-block-end: $expander-size solid var-get($theme, 'expander-color'); &::before { - top: calc(100% - #{map.get($theme, 'size')}); - left: calc(100% - (#{map.get($theme, 'size')} * 2)); - width: calc(#{map.get($theme, 'size')} * 4); - height: calc(#{map.get($theme, 'size')} * 3); + top: calc(100% - #{$expander-size}); + left: calc(100% - (#{$expander-size} * 2)); + width: calc(#{$expander-size} * 4); + height: calc(#{$expander-size} * 3); } } @include e(expander, $m: 'end') { - border-block-start: $splitter-size solid + border-block-start: $expander-size solid var-get($theme, 'expander-color'); &::before { - top: calc(100% - (#{map.get($theme, 'size')} * 2)); - left: calc(100% - (#{map.get($theme, 'size')} * 2)); - width: calc(#{map.get($theme, 'size')} * 4); - height: calc(#{map.get($theme, 'size')} * 3); + top: calc(100% - (#{$expander-size} * 2)); + left: calc(100% - (#{$expander-size} * 2)); + width: calc(#{$expander-size} * 4); + height: calc(#{$expander-size} * 3); } } @@ -172,8 +187,8 @@ $theme: digest-schema($light-splitter); @include m(vertical) { flex-direction: column; + width: $bar-size; height: 100%; - padding: 0 rem(1px); &::before, &::after { @@ -191,32 +206,32 @@ $theme: digest-schema($light-splitter); } @include e(expander, $m: 'start') { - border-block-start: $splitter-size solid transparent; - border-inline-end: $splitter-size solid + border-block-start: $expander-size solid transparent; + border-inline-end: $expander-size solid var-get($theme, 'expander-color'); - border-block-end: $splitter-size solid transparent; + border-block-end: $expander-size solid transparent; border-inline-start: unset; &::before { - top: calc(100% - (#{map.get($theme, 'size')} * 2)); - left: calc(100% - (#{map.get($theme, 'size')})); - width: calc(#{map.get($theme, 'size')} * 3); - height: calc(#{map.get($theme, 'size')} * 4); + top: calc(100% - (#{$expander-size} * 2)); + left: calc(100% - (#{$expander-size})); + width: calc(#{$expander-size} * 3); + height: calc(#{$expander-size} * 4); } } @include e(expander, $m: 'end') { - border-block-start: $splitter-size solid transparent; + border-block-start: $expander-size solid transparent; border-inline-end: unset; - border-block-end: $splitter-size solid transparent; - border-inline-start: $splitter-size solid + border-block-end: $expander-size solid transparent; + border-inline-start: $expander-size solid var-get($theme, 'expander-color'); &::before { - top: calc(100% - (#{map.get($theme, 'size')} * 2)); - left: calc(100% - (#{map.get($theme, 'size')} * 2)); - height: calc(#{map.get($theme, 'size')} * 4); - width: calc(#{map.get($theme, 'size')} * 3); + top: calc(100% - (#{$expander-size} * 2)); + left: calc(100% - (#{$expander-size} * 2)); + height: calc(#{$expander-size} * 4); + width: calc(#{$expander-size} * 3); } } diff --git a/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss b/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss index 365f9b2567e..479e771953a 100644 --- a/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss +++ b/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss @@ -5,7 +5,11 @@ @use 'igniteui-theming/sass/themes/schemas/components/light/splitter' as *; $theme: digest-schema($indigo-splitter); -$slim-splitter: calc(1 / var(--splitter-size)); +$bar-size: var(--_bar-size); + +// The scale that leaves 1px of the bar: 1px / bar thickness, as a number. +// CSS can't divide two lengths, and tan(atan2(a, b)) equals a / b. +$slim-splitter: tan(atan2(1px, #{$bar-size})); @include themed-block(igx-splitter, indigo) { @include b(igx-splitter-bar-host) { @@ -97,14 +101,14 @@ $slim-splitter: calc(1 / var(--splitter-size)); @include m(horizontal) { &::before, &::after { - height: calc(var(--splitter-size) * 4px); + height: calc(#{$bar-size} * 4); } } @include m(vertical) { &::before, &::after { - width: calc(var(--splitter-size) * 4px); + width: calc(#{$bar-size} * 4); } } } From aa9eab986806ef288163411a34ea836a3875c8ec Mon Sep 17 00:00:00 2001 From: desig9stein Date: Sat, 21 Nov 2026 10:21:58 +0200 Subject: [PATCH 2/7] 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. --- CHANGELOG.md | 2 +- .../splitter/src/splitter/themes/shared/indigo.scss | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f27cba5c110..b32efe3af9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes for each version of this project will be documented in this ### New Functionality - `IgxSplitterComponent` - - The splitter follows `--ig-size`. The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px with a 2px, 8px or 8px radius, and the expanders grow with them. The default is small, which is the size from before, so a splitter without `--ig-size` looks the same. `--size` and `--ig-splitter-size` still set the small size, and the medium and large steps add to it. A `--border-radius` or `--ig-splitter-border-radius` that you set applies at every size. In the Indigo theme the idle bar is 1px thick also with an overridden size, where it was thicker before (2px for `--ig-splitter-size: 10px`), and the area around the bar that takes the pointer grows with the bar. Previously the splitter had one size, so an app that sets `--ig-size` to medium or large on the splitter or on an ancestor now gets a thicker bar (#18013). + - The splitter follows `--ig-size`. The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px with a 2px, 8px or 8px radius, and the expanders grow with them. The default is small, which is the size from before, so a splitter without `--ig-size` looks the same. `--size` and `--ig-splitter-size` still set the small size, and the medium and large steps add to it. A `--border-radius` or `--ig-splitter-border-radius` that you set applies at every size. In the Indigo theme the idle bar is 1px, 4px or 8px thick by size, also with an overridden size, where the 1px was thicker before (2px for `--ig-splitter-size: 10px`), and the area around the bar that takes the pointer grows with the bar. Previously the splitter had one size, so an app that sets `--ig-size` to medium or large on the splitter or on an ancestor now gets a thicker bar (#18013). ```html ... ``` diff --git a/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss b/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss index 479e771953a..98bd4a2227c 100644 --- a/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss +++ b/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss @@ -1,17 +1,24 @@ /* stylelint-disable max-nesting-depth */ @use 'igniteui-theming/sass/animations' as *; @use 'igniteui-theming/sass/bem' as *; +@use 'igniteui-theming/sass/themes' as *; +@use 'igniteui-theming/sass/typography' as *; @use '../../../../../core/src/core/styles/themes/scoping' as *; @use 'igniteui-theming/sass/themes/schemas/components/light/splitter' as *; $theme: digest-schema($indigo-splitter); $bar-size: var(--_bar-size); -// The scale that leaves 1px of the bar: 1px / bar thickness, as a number. +// The scale that leaves the idle thickness of the bar: idle / bar thickness, as a number. // CSS can't divide two lengths, and tan(atan2(a, b)) equals a / b. -$slim-splitter: tan(atan2(1px, #{$bar-size})); +$slim-splitter: tan(atan2(var(--_idle-size), #{$bar-size})); @include themed-block(igx-splitter, indigo) { + @include b(igx-splitter) { + // Mirrored by the :host block of the indigo igc-splitter theme in igniteui-webcomponents. + --_idle-size: #{sizable(rem(1px), rem(4px), rem(8px))}; + } + @include b(igx-splitter-bar-host) { transition: box-shadow 0.25s 0.1s ease-in; From 5af2a798098b107b3e19c45231213f8cf7a9cfd6 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Sat, 21 Nov 2026 10:39:30 +0200 Subject: [PATCH 3/7] 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. --- CHANGELOG.md | 2 +- projects/igniteui-angular/splitter/README.md | 2 ++ .../src/splitter/splitter.component.spec.ts | 29 +++++++++++++------ .../splitter/src/splitter/themes/_base.scss | 16 ++++++++-- .../src/splitter/themes/shared/indigo.scss | 3 ++ 5 files changed, 40 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b32efe3af9a..bf1f9f77733 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes for each version of this project will be documented in this ### New Functionality - `IgxSplitterComponent` - - The splitter follows `--ig-size`. The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px with a 2px, 8px or 8px radius, and the expanders grow with them. The default is small, which is the size from before, so a splitter without `--ig-size` looks the same. `--size` and `--ig-splitter-size` still set the small size, and the medium and large steps add to it. A `--border-radius` or `--ig-splitter-border-radius` that you set applies at every size. In the Indigo theme the idle bar is 1px, 4px or 8px thick by size, also with an overridden size, where the 1px was thicker before (2px for `--ig-splitter-size: 10px`), and the area around the bar that takes the pointer grows with the bar. Previously the splitter had one size, so an app that sets `--ig-size` to medium or large on the splitter or on an ancestor now gets a thicker bar (#18013). + - The splitter follows `--ig-size`. The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px with a 2px, 8px or 8px radius, and the expanders grow with them. The default is small, which is the size from before, so a splitter without `--ig-size` looks the same. `--size` and `--ig-splitter-size` still set the small size, and the medium and large steps add to it. A `--border-radius` or `--ig-splitter-border-radius` that you set applies at every size. The 48px gap around the drag handle is measured from the icon box of the design, so each expander is 5px further from the handle than before at the default size, 3px in the Indigo theme. In the Indigo theme the idle bar is 1px, 4px or 8px thick by size, also with an overridden size, where the 1px was thicker before (2px for `--ig-splitter-size: 10px`), and the area around the bar that takes the pointer grows with the bar. Previously the splitter had one size, so an app that sets `--ig-size` to medium or large on the splitter or on an ancestor now gets a thicker bar (#18013). ```html ... ``` diff --git a/projects/igniteui-angular/splitter/README.md b/projects/igniteui-angular/splitter/README.md index 4781c70be02..5168a0c6dad 100644 --- a/projects/igniteui-angular/splitter/README.md +++ b/projects/igniteui-angular/splitter/README.md @@ -73,6 +73,8 @@ export class SplitLayoutComponent { The steps add to the `size` theme token (4px), so `--ig-splitter-size: 10px` makes the bar 12px, 18px and 24px and the drag handle 10px, 12px and 14px. + The drag handle is 48px from the icon box of each expander: the 18px, 20px and 24px icon of the design, 14px, 16px and 24px in the Indigo theme. In the Indigo theme the idle bar is 1px, 4px and 8px thick by size. + ## API Reference ### IgxSplitterComponent inputs diff --git a/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts b/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts index fcad0db01a2..88a90ba53a6 100644 --- a/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts +++ b/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts @@ -927,9 +927,9 @@ describe('IgxSplitter resizing with minSize and browser window is shrinked', () describe('IgxSplitter sizing', () => { const steps = [ - { size: 'small', value: '1', bar: 6, handle: 4, expander: 4, radius: 2 }, - { size: 'medium', value: '2', bar: 12, handle: 6, expander: 5, radius: 8 }, - { size: 'large', value: '3', bar: 18, handle: 8, expander: 6, radius: 8 } + { size: 'small', value: '1', bar: 6, handle: 4, expander: 4, radius: 2, space: 5 }, + { size: 'medium', value: '2', bar: 12, handle: 6, expander: 5, radius: 8, space: 5 }, + { size: 'large', value: '3', bar: 18, handle: 8, expander: 6, radius: 8, space: 6 } ]; let fixture: ComponentFixture; @@ -1018,7 +1018,18 @@ describe('IgxSplitter sizing', () => { }; }; - it('should keep the handle 48px from the bar content edge with a collapsed pane', () => { + it('should keep 48px between the handle and the icon box of each expander at every size', () => { + for (const step of steps) { + fixture.componentInstance.size = step.value; + fixture.detectChanges(); + document.getAnimations().forEach(animation => animation.finish()); + + const gap = 48 + step.space; + expect(gaps().handleGaps, step.size).toEqual([gap, gap]); + } + }); + + it('should keep the 48px margins around the handle with a collapsed pane', () => { const panes = fixture.componentInstance.splitter.panes.toArray(); const handleTop = () => { const host: HTMLElement = fixture.nativeElement; @@ -1026,8 +1037,8 @@ describe('IgxSplitter sizing', () => { return host.querySelector('.igx-splitter-bar__handle').getBoundingClientRect().top - host.querySelector(SPLITTERBAR_DIV_CLASS).getBoundingClientRect().top; }; - // The handle, its two 48px margins and the one expander that is left, centered in the 400px bar. - const groupStart = (400 - (100 + 96 + 8)) / 2; + // The handle, its two 48px margins and the 18px box of the one expander that is left, centered in the 400px bar. + const groupStart = (400 - (100 + 96 + 18)) / 2; panes[0].toggle(); fixture.detectChanges(); @@ -1036,7 +1047,7 @@ describe('IgxSplitter sizing', () => { panes[0].toggle(); panes[1].toggle(); fixture.detectChanges(); - expect(handleTop()).toBe(groupStart + 8 + 48); + expect(handleTop()).toBe(groupStart + 18 + 48); }); it('should keep the handle at 25% of a short bar and narrow the gaps at every size', () => { @@ -1048,8 +1059,8 @@ describe('IgxSplitter sizing', () => { const { handleLength } = measure(); const { handleGaps, inside } = gaps(); - // What the bar leaves after the handle and the two expanders, halved. - const gap = (128 - 32 - step.expander * 4) / 2; + // Half of what the bar leaves after the handle, less the triangle and the space on its far side. + const gap = (128 - 32) / 2 - step.expander * 2 - step.space; expect(handleLength, step.size).toBe(32); expect(handleGaps, step.size).toEqual([gap, gap]); diff --git a/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss b/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss index d068d8bf53d..e8ad7153a69 100644 --- a/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss +++ b/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss @@ -16,6 +16,10 @@ $theme: digest-schema($light-splitter); $bar-size: var(--_bar-size); $handle-size: var(--_handle-size); $expander-size: var(--_expander-size); + $expander-space: var(--_expander-space); + + // The length an expander takes of the bar: the triangle and the space on its two sides. + $expander-box: calc(2 * #{$expander-size} + 2 * #{$expander-space}); $hitbox-size: rem(4px); $debug-hitbox: false; $hitbox-debug-color: rgba(coral, 0.24); @@ -31,6 +35,9 @@ $theme: digest-schema($light-splitter); --_handle-size: #{sizable($size, calc(#{$size} + #{rem(2px)}), calc(#{$size} + #{rem(4px)}))}; --_expander-size: #{sizable($size, calc(#{$size} + #{rem(1px)}), calc(#{$size} + #{rem(2px)}))}; + // The space from a triangle to the edge of the 18px, 20px and 24px icon box of the design. + --_expander-space: #{sizable(rem(5px), rem(5px), rem(6px))}; + &[aria-orientation='horizontal'] { [dir='rtl'] & { flex-direction: row-reverse !important; @@ -116,13 +123,13 @@ $theme: digest-schema($light-splitter); // The room for one margin when the bar is too short for 48px: half of what the 25% handle // leaves, less one expander. 1cqw is 1% of the bar length, with the bar as the size container. - margin: 0 clamp(0px, calc((100cqw - 25cqw) / 2 - 2 * #{$expander-size}), #{rem(48px)}); + margin: 0 clamp(0px, calc((100cqw - 25cqw) / 2 - #{$expander-box}), #{rem(48px)}); } @include e(handle, $m: vertical) { width: $handle-size; height: 25%; - margin: clamp(0px, calc((100cqh - 25cqh) / 2 - 2 * #{$expander-size}), #{rem(48px)}) 0; + margin: clamp(0px, calc((100cqh - 25cqh) / 2 - #{$expander-box}), #{rem(48px)}) 0; } @include e(expander) { @@ -131,6 +138,7 @@ $theme: digest-schema($light-splitter); height: 0; border-inline-end: $expander-size solid transparent; border-inline-start: $expander-size solid transparent; + margin: 0 $expander-space; cursor: pointer; opacity: 0; transition: opacity 0.25s 0.5s ease; @@ -205,6 +213,10 @@ $theme: digest-schema($light-splitter); left: 100%; } + @include e(expander) { + margin: $expander-space 0; + } + @include e(expander, $m: 'start') { border-block-start: $expander-size solid transparent; border-inline-end: $expander-size solid diff --git a/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss b/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss index 98bd4a2227c..7d5b144592e 100644 --- a/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss +++ b/projects/igniteui-angular/splitter/src/splitter/themes/shared/indigo.scss @@ -17,6 +17,9 @@ $slim-splitter: tan(atan2(var(--_idle-size), #{$bar-size})); @include b(igx-splitter) { // Mirrored by the :host block of the indigo igc-splitter theme in igniteui-webcomponents. --_idle-size: #{sizable(rem(1px), rem(4px), rem(8px))}; + + // The icon box of the design is 14px, 16px and 24px in this theme. + --_expander-space: #{sizable(rem(3px), rem(3px), rem(6px))}; } @include b(igx-splitter-bar-host) { From e8bfe97b9a10f6a6b75804c5abf7158c26ea6576 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Mon, 23 Nov 2026 16:06:40 +0200 Subject: [PATCH 4/7] 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. --- package-lock.json | 431 +------------------------ package.json | 2 +- projects/igniteui-angular/package.json | 2 +- 3 files changed, 13 insertions(+), 422 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1f722b5f815..377f446196c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -80,7 +80,7 @@ "igniteui-grid-lite": "~0.12.0", "igniteui-i18n-resources": "^2.0.0", "igniteui-sassdoc-theme": "^3.0.0", - "igniteui-theming": "^30.2.0", + "igniteui-theming": "^30.3.0", "igniteui-webcomponents": "^7.5.0", "lit-html": "^3.2.1", "ng-packagr": "^22.0.0", @@ -9017,13 +9017,6 @@ "ieee754": "^1.1.13" } }, - "node_modules/buffer-builder": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/buffer-builder/-/buffer-builder-0.2.0.tgz", - "integrity": "sha512-7VPMEPuYznPSoR21NE1zvd2Xna6c/CloiZCfcMXR1Jny6PjX0N4Nsa38zcBFo/FMK+BlA+FLKbJCQ0i2yxp+Xg==", - "dev": true, - "license": "MIT/X11" - }, "node_modules/buffer-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.1.tgz", @@ -14307,429 +14300,27 @@ } }, "node_modules/igniteui-theming": { - "version": "30.2.0", - "resolved": "https://registry.npmjs.org/igniteui-theming/-/igniteui-theming-30.2.0.tgz", - "integrity": "sha512-nYdHKYG1FjuzB3rpz6sLlc2sYTR4HOABB3wuWokQwZj8i/cfvoBbJrsH9JESXGwcyYuq++3ZaaFG4yWBWEZG7Q==", + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/igniteui-theming/-/igniteui-theming-30.3.0.tgz", + "integrity": "sha512-wBA819JhqdDYkCUF6Y/EE1n93rfflJuYEZhd1U28zvQlRBBaM702BLoNb1pno1tziQ63BaXqHv1QMjPpn0i8iQ==", "dev": true, "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.32.1", - "sass-embedded": "~1.92.1", + "sass-embedded": "^1.97.1", "zod": "^4.6.7" }, "bin": { "igniteui-theming": "dist/mcp/index.js", "igniteui-theming-mcp": "dist/mcp/index.js" - } - }, - "node_modules/igniteui-theming/node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/igniteui-theming/node_modules/colorjs.io": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/colorjs.io/-/colorjs.io-0.5.2.tgz", - "integrity": "sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw==", - "dev": true, - "license": "MIT" - }, - "node_modules/igniteui-theming/node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 14.18.0" }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/igniteui-theming/node_modules/sass": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.92.1.tgz", - "integrity": "sha512-ffmsdbwqb3XeyR8jJR6KelIXARM9bFQe8A6Q3W4Klmwy5Ckd5gz7jgUNHo4UOqutU5Sk1DtKLbpDP0nLCg1xqQ==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "chokidar": "^4.0.0", - "immutable": "^5.0.2", - "source-map-js": ">=0.6.2 <2.0.0" - }, - "bin": { - "sass": "sass.js" - }, - "engines": { - "node": ">=14.0.0" - }, - "optionalDependencies": { - "@parcel/watcher": "^2.4.1" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded/-/sass-embedded-1.92.1.tgz", - "integrity": "sha512-28YwLnF5atAhogt3E4hXzz/NB9dwKffyw08a7DEasLh94P7+aELkG3ENSHYCWB9QFN14hYNLfwr9ozUsPDhcDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@bufbuild/protobuf": "^2.5.0", - "buffer-builder": "^0.2.0", - "colorjs.io": "^0.5.0", - "immutable": "^5.0.2", - "rxjs": "^7.4.0", - "supports-color": "^8.1.1", - "sync-child-process": "^1.0.2", - "varint": "^6.0.0" - }, - "bin": { - "sass": "dist/bin/sass.js" - }, - "engines": { - "node": ">=16.0.0" + "peerDependencies": { + "sass": ">=1.97.1" }, - "optionalDependencies": { - "sass-embedded-all-unknown": "1.92.1", - "sass-embedded-android-arm": "1.92.1", - "sass-embedded-android-arm64": "1.92.1", - "sass-embedded-android-riscv64": "1.92.1", - "sass-embedded-android-x64": "1.92.1", - "sass-embedded-darwin-arm64": "1.92.1", - "sass-embedded-darwin-x64": "1.92.1", - "sass-embedded-linux-arm": "1.92.1", - "sass-embedded-linux-arm64": "1.92.1", - "sass-embedded-linux-musl-arm": "1.92.1", - "sass-embedded-linux-musl-arm64": "1.92.1", - "sass-embedded-linux-musl-riscv64": "1.92.1", - "sass-embedded-linux-musl-x64": "1.92.1", - "sass-embedded-linux-riscv64": "1.92.1", - "sass-embedded-linux-x64": "1.92.1", - "sass-embedded-unknown-all": "1.92.1", - "sass-embedded-win32-arm64": "1.92.1", - "sass-embedded-win32-x64": "1.92.1" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-all-unknown": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-all-unknown/-/sass-embedded-all-unknown-1.92.1.tgz", - "integrity": "sha512-5t6/YZf+vhO3OY/49h8RCL6Cwo78luva0M+TnTM9gu9ASffRXAuOVLNKciSXa3loptyemDDS6IU5/dVH5w0KmA==", - "cpu": [ - "!arm", - "!arm64", - "!riscv64", - "!x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "sass": "1.92.1" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-android-arm": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-android-arm/-/sass-embedded-android-arm-1.92.1.tgz", - "integrity": "sha512-4EjpVVzuksERdgAd4BqeSXFnWtWN3DSRyEIUPJ7BhcS9sfDh2Gf6miI2kNTvIQLJ2XIJynDDcEQ8a1U9KwKUTQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-android-arm64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-android-arm64/-/sass-embedded-android-arm64-1.92.1.tgz", - "integrity": "sha512-Q+UruGb7yKawHagVmVDRRKsnc4mJZvWMBnuRCu2coJo2FofyqBmXohVGXbxko97sYceA9TJTrUEx3WVKQUNCbQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-android-riscv64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-android-riscv64/-/sass-embedded-android-riscv64-1.92.1.tgz", - "integrity": "sha512-nCY5btLlX7W7Jc6cCL6D2Yklpiu540EJ2G08YVGu12DrAMCBzqM347CSRf2ojp1H8jyhvmLkaFwnrJWzh+6S+w==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-android-x64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-android-x64/-/sass-embedded-android-x64-1.92.1.tgz", - "integrity": "sha512-qYWR3bftJ77aLYwYDFuzDI4dcwVVixxqQxlIQWNGkHRCexj614qGSSHemr18C2eVj3mjXAQxTQxU68U7pkGPAA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-darwin-arm64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-darwin-arm64/-/sass-embedded-darwin-arm64-1.92.1.tgz", - "integrity": "sha512-g2yQ3txjMYLKMjL2cW1xRO9nnV3ijf95NbX/QShtV6tiVUETZNWDsRMDEwBNGYY6PTE/UZerjJL1R/2xpQg6WA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-darwin-x64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-darwin-x64/-/sass-embedded-darwin-x64-1.92.1.tgz", - "integrity": "sha512-eH+fgxLQhTEPjZPCgPAVuX5e514Qp/4DMAUMtlNShv4cr4TD5qOp1XlsPYR/b7uE7p2cKFkUpUn/bHNqJ2ay4A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-linux-arm": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-arm/-/sass-embedded-linux-arm-1.92.1.tgz", - "integrity": "sha512-cT3w8yoQTqrtZvWLJeutEGmawITDTY4J6oSVQjeDcPnnoPt0gOFxem8YMznraACXvahw/2+KJDH33BTNgiPo0A==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-linux-arm64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-arm64/-/sass-embedded-linux-arm64-1.92.1.tgz", - "integrity": "sha512-dNmlpGeZkry1BofhAdGFBXrpM69y9LlYuNnncf+HfsOOUtj8j0q1RwS+zb5asknhKFUOAG8GCGRY1df7Rwu35g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-linux-musl-arm": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-arm/-/sass-embedded-linux-musl-arm-1.92.1.tgz", - "integrity": "sha512-nPBos6lI31ef2zQhqTZhFOU7ar4impJbLIax0XsqS269YsiCwjhk11VmUloJTpFlJuKMiVXNo7dPx+katxhD/Q==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-linux-musl-arm64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-arm64/-/sass-embedded-linux-musl-arm64-1.92.1.tgz", - "integrity": "sha512-TfiEBkCyNzVoOhjHXUT+vZ6+p0ueDbvRw6f4jHdkvljZzXdXMby4wh7BU1odl69rgRTkSvYKhgbErRLDR/F7pQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-linux-musl-riscv64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-riscv64/-/sass-embedded-linux-musl-riscv64-1.92.1.tgz", - "integrity": "sha512-R+RcJA4EYpJDE9JM1GgPYgZo7x94FlxZ6jPodOQkEaZ1S9kvXVCuP5X/0PXRPhu08KJOfeMsAElzfdAjUf7KJg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-linux-musl-x64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-x64/-/sass-embedded-linux-musl-x64-1.92.1.tgz", - "integrity": "sha512-/HolYRGXJjx8nLw6oj5ZrkR7PFM7X/5kE4MYZaFMpDIPIcw3bqB2fUXLo/MYlRLsw7gBAT6hJAMBrNdKuTphfw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-linux-riscv64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-riscv64/-/sass-embedded-linux-riscv64-1.92.1.tgz", - "integrity": "sha512-b9bxe0CMsbSsLx3nrR0cq8xpIkoAC6X36o4DGMITF3m2v3KsojC7ru9X0Gz+zUFr6rwpq/0lTNzFLNu6sPNo3w==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-linux-x64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-x64/-/sass-embedded-linux-x64-1.92.1.tgz", - "integrity": "sha512-xuiK5Jp5NldW4bvlC7AuX1Wf7o0gLZ3md/hNg+bkTvxtCDgnUHtfdo8Q+xWP11bD9QX31xXFWpmUB8UDLi6XQQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-unknown-all": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-unknown-all/-/sass-embedded-unknown-all-1.92.1.tgz", - "integrity": "sha512-AT9oXvtNY4N+Nd0wvoWqq9A5HjdH/X3aUH4boQUtXyaJ/9DUwnQmBpP5Gtn028ZS8exOGBdobmmWAuigv0k/OA==", - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "!android", - "!darwin", - "!linux", - "!win32" - ], - "dependencies": { - "sass": "1.92.1" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-win32-arm64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-win32-arm64/-/sass-embedded-win32-arm64-1.92.1.tgz", - "integrity": "sha512-KvmpQjY9yTBMtTYz4WBqetlv9bGaDW1aStcu7MSTbH7YiSybX/9fnxlCAEQv1WlIidQhcJAiyk0Eae+LGK7cIQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/igniteui-theming/node_modules/sass-embedded-win32-x64": { - "version": "1.92.1", - "resolved": "https://registry.npmjs.org/sass-embedded-win32-x64/-/sass-embedded-win32-x64-1.92.1.tgz", - "integrity": "sha512-B6Nz/GbH7Vkpb2TkQHsGcczWM5t+70VWopWF1x5V5yxLpA8ZzVQ7NTKKi+jDoVY2Efu6ZyzgT9n5KgG2kWliXA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=14.0.0" + "peerDependenciesMeta": { + "sass": { + "optional": true + } } }, "node_modules/igniteui-theming/node_modules/zod": { diff --git a/package.json b/package.json index 78aa64625dd..00c896e3252 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "igniteui-grid-lite": "~0.12.0", "igniteui-i18n-resources": "^2.0.0", "igniteui-sassdoc-theme": "^3.0.0", - "igniteui-theming": "^30.2.0", + "igniteui-theming": "^30.3.0", "igniteui-webcomponents": "^7.5.0", "lit-html": "^3.2.1", "ng-packagr": "^22.0.0", diff --git a/projects/igniteui-angular/package.json b/projects/igniteui-angular/package.json index dc07f364428..4f23407bf59 100644 --- a/projects/igniteui-angular/package.json +++ b/projects/igniteui-angular/package.json @@ -75,7 +75,7 @@ "igniteui-trial-watermark": "^3.1.0", "jspdf": "^4.2.1", "lodash-es": "^4.17.21", - "igniteui-theming": "^30.2.0", + "igniteui-theming": "^30.3.0", "igniteui-i18n-core": "^2.0.0", "@igniteui/material-icons-extended": "^3.1.0" }, From 12c50c07aa5a3271fffd9ece7ff72a9db319dd93 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Mon, 23 Nov 2026 16:37:01 +0200 Subject: [PATCH 5/7] 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. --- CHANGELOG.md | 2 +- projects/igniteui-angular/splitter/README.md | 2 +- .../src/splitter/splitter.component.spec.ts | 54 +++++++++++++++++++ .../splitter/src/splitter/themes/_base.scss | 27 ++++------ 4 files changed, 67 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf1f9f77733..ab3958031be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes for each version of this project will be documented in this ### New Functionality - `IgxSplitterComponent` - - The splitter follows `--ig-size`. The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px with a 2px, 8px or 8px radius, and the expanders grow with them. The default is small, which is the size from before, so a splitter without `--ig-size` looks the same. `--size` and `--ig-splitter-size` still set the small size, and the medium and large steps add to it. A `--border-radius` or `--ig-splitter-border-radius` that you set applies at every size. The 48px gap around the drag handle is measured from the icon box of the design, so each expander is 5px further from the handle than before at the default size, 3px in the Indigo theme. In the Indigo theme the idle bar is 1px, 4px or 8px thick by size, also with an overridden size, where the 1px was thicker before (2px for `--ig-splitter-size: 10px`), and the area around the bar that takes the pointer grows with the bar. Previously the splitter had one size, so an app that sets `--ig-size` to medium or large on the splitter or on an ancestor now gets a thicker bar (#18013). + - The splitter follows `--ig-size`. The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px with a 2px, 8px or 8px radius, and the expanders grow with them. The default is small, which is the size from before, so a splitter without `--ig-size` looks the same. `--size` and `--ig-splitter-size` still set the small size, and the medium and large steps add to it. A `--border-radius` or `--ig-splitter-border-radius` that you set applies at every size. The 48px gap around the drag handle is measured from the icon box of the design, so each expander is 5px further from the handle than before at the default size, 3px in the Indigo theme. The area of an expander that takes the pointer is that icon box, centered on the arrow: 18px, 20px or 24px square, 14px, 16px or 24px in the Indigo theme. Previously it was 16px by 12px at the default size in every theme. In the Indigo theme the idle bar is 1px, 4px or 8px thick by size, also with an overridden size, where the 1px was thicker before (2px for `--ig-splitter-size: 10px`), and the area around the bar that takes the pointer grows with the bar. Previously the splitter had one size, so an app that sets `--ig-size` to medium or large on the splitter or on an ancestor now gets a thicker bar (#18013). ```html ... ``` diff --git a/projects/igniteui-angular/splitter/README.md b/projects/igniteui-angular/splitter/README.md index 5168a0c6dad..b8b49477a72 100644 --- a/projects/igniteui-angular/splitter/README.md +++ b/projects/igniteui-angular/splitter/README.md @@ -73,7 +73,7 @@ export class SplitLayoutComponent { The steps add to the `size` theme token (4px), so `--ig-splitter-size: 10px` makes the bar 12px, 18px and 24px and the drag handle 10px, 12px and 14px. - The drag handle is 48px from the icon box of each expander: the 18px, 20px and 24px icon of the design, 14px, 16px and 24px in the Indigo theme. In the Indigo theme the idle bar is 1px, 4px and 8px thick by size. + The drag handle is 48px from the icon box of each expander: the 18px, 20px and 24px icon of the design, 14px, 16px and 24px in the Indigo theme. That box, centered on the arrow, is also the area of the expander that takes the pointer. In the Indigo theme the idle bar is 1px, 4px and 8px thick by size. ## API Reference diff --git a/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts b/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts index 88a90ba53a6..1aa1faa0fdf 100644 --- a/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts +++ b/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts @@ -1029,6 +1029,60 @@ describe('IgxSplitter sizing', () => { } }); + const hitboxes = () => { + const host: HTMLElement = fixture.nativeElement; + document.getAnimations().forEach(animation => animation.finish()); + + return ['start', 'end'].map(side => { + const expander = host.querySelector(`.igx-splitter-bar__expander--${side}`); + const border = getComputedStyle(expander); + const box = getComputedStyle(expander, '::before'); + const px = (value: string) => parseFloat(value); + const width = px(box.width); + const height = px(box.height); + + // Read from the computed styles, which the scale of the idle indigo bar does not change. + return { + width, + height, + // The offset of the center of the hitbox from the center of the triangle. + offsetX: px(box.left) + width / 2 - (px(border.borderRightWidth) - px(border.borderLeftWidth)) / 2, + offsetY: px(box.top) + height / 2 - (px(border.borderBottomWidth) - px(border.borderTopWidth)) / 2 + }; + }); + }; + + it('should size the hitbox of each expander to the icon box and center it on the triangle', () => { + for (const type of [SplitterType.Horizontal, SplitterType.Vertical]) { + fixture.componentInstance.type = type; + + for (const step of steps) { + fixture.componentInstance.size = step.value; + fixture.detectChanges(); + + const box = 2 * step.expander + 2 * step.space; + const centered = { width: box, height: box, offsetX: 0, offsetY: 0 }; + expect(hitboxes(), `${step.size} ${type}`).toEqual([centered, centered]); + } + } + }); + + it('should size the hitbox to the 14px, 16px and 24px icon box in the indigo theme', () => { + document.documentElement.style.setProperty('--ig-theme', 'indigo'); + + try { + for (const [index, box] of [14, 16, 24].entries()) { + fixture.componentInstance.size = steps[index].value; + fixture.detectChanges(); + + const centered = { width: box, height: box, offsetX: 0, offsetY: 0 }; + expect(hitboxes(), steps[index].size).toEqual([centered, centered]); + } + } finally { + document.documentElement.style.removeProperty('--ig-theme'); + } + }); + it('should keep the 48px margins around the handle with a collapsed pane', () => { const panes = fixture.componentInstance.splitter.panes.toArray(); const handleTop = () => { diff --git a/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss b/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss index e8ad7153a69..c42c3a86385 100644 --- a/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss +++ b/projects/igniteui-angular/splitter/src/splitter/themes/_base.scss @@ -145,9 +145,12 @@ $theme: digest-schema($light-splitter); pointer-events: none; z-index: 1; + // The hitbox is the icon box of the design, centered on the triangle. &::before { position: absolute; content: ''; + width: $expander-box; + height: $expander-box; background: if($debug-hitbox, $hitbox-debug-color, transparent); } } @@ -157,10 +160,8 @@ $theme: digest-schema($light-splitter); var-get($theme, 'expander-color'); &::before { - top: calc(100% - #{$expander-size}); - left: calc(100% - (#{$expander-size} * 2)); - width: calc(#{$expander-size} * 4); - height: calc(#{$expander-size} * 3); + top: calc((#{$expander-size} - #{$expander-box}) / 2); + inset-inline-start: calc(#{$expander-box} / -2); } } @@ -169,10 +170,8 @@ $theme: digest-schema($light-splitter); var-get($theme, 'expander-color'); &::before { - top: calc(100% - (#{$expander-size} * 2)); - left: calc(100% - (#{$expander-size} * 2)); - width: calc(#{$expander-size} * 4); - height: calc(#{$expander-size} * 3); + top: calc((#{$expander-size} + #{$expander-box}) / -2); + inset-inline-start: calc(#{$expander-box} / -2); } } @@ -225,10 +224,8 @@ $theme: digest-schema($light-splitter); border-inline-start: unset; &::before { - top: calc(100% - (#{$expander-size} * 2)); - left: calc(100% - (#{$expander-size})); - width: calc(#{$expander-size} * 3); - height: calc(#{$expander-size} * 4); + top: calc(#{$expander-box} / -2); + inset-inline-start: calc((#{$expander-size} - #{$expander-box}) / 2); } } @@ -240,10 +237,8 @@ $theme: digest-schema($light-splitter); var-get($theme, 'expander-color'); &::before { - top: calc(100% - (#{$expander-size} * 2)); - left: calc(100% - (#{$expander-size} * 2)); - height: calc(#{$expander-size} * 4); - width: calc(#{$expander-size} * 3); + top: calc(#{$expander-box} / -2); + inset-inline-start: calc((#{$expander-size} + #{$expander-box}) / -2); } } From 5ef2ac36066bd82872157d96c68808e906ad0ece Mon Sep 17 00:00:00 2001 From: desig9stein Date: Mon, 23 Nov 2026 16:38:06 +0200 Subject: [PATCH 6/7] test(splitter): check the hitbox of the expanders in the default theme only --- .../src/splitter/splitter.component.spec.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts b/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts index 1aa1faa0fdf..f6b3651bf44 100644 --- a/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts +++ b/projects/igniteui-angular/splitter/src/splitter/splitter.component.spec.ts @@ -1041,7 +1041,6 @@ describe('IgxSplitter sizing', () => { const width = px(box.width); const height = px(box.height); - // Read from the computed styles, which the scale of the idle indigo bar does not change. return { width, height, @@ -1067,22 +1066,6 @@ describe('IgxSplitter sizing', () => { } }); - it('should size the hitbox to the 14px, 16px and 24px icon box in the indigo theme', () => { - document.documentElement.style.setProperty('--ig-theme', 'indigo'); - - try { - for (const [index, box] of [14, 16, 24].entries()) { - fixture.componentInstance.size = steps[index].value; - fixture.detectChanges(); - - const centered = { width: box, height: box, offsetX: 0, offsetY: 0 }; - expect(hitboxes(), steps[index].size).toEqual([centered, centered]); - } - } finally { - document.documentElement.style.removeProperty('--ig-theme'); - } - }); - it('should keep the 48px margins around the handle with a collapsed pane', () => { const panes = fixture.componentInstance.splitter.panes.toArray(); const handleTop = () => { From d0eb77f633d9aa1236d3d764b568ac806da88881 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Wed, 25 Nov 2026 13:28:03 +0200 Subject: [PATCH 7/7] 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. --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab3958031be..4cb4cecdbe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,17 @@ All notable changes for each version of this project will be documented in this ## 22.3.1 +### General + +- `IgxSplitterComponent` + - An app that sets `--ig-size` to medium or large on the splitter or on an ancestor gets a thicker bar. Previously the splitter had one size (#18013). + - The 48px gap around the drag handle is measured from the icon box of the design, so each expander is 5px further from the handle at the default size, 3px in the Indigo theme. The area of an expander that takes the pointer is that icon box, centered on the arrow: 18px, 20px or 24px square, 14px, 16px or 24px in the Indigo theme. Previously it was 16px by 12px at the default size in every theme. + - In the Indigo theme, the idle bar is 1px thick at the default size also with an overridden `--ig-splitter-size`. Previously it was thicker, 2px for `--ig-splitter-size: 10px`. + ### New Functionality - `IgxSplitterComponent` - - The splitter follows `--ig-size`. The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px with a 2px, 8px or 8px radius, and the expanders grow with them. The default is small, which is the size from before, so a splitter without `--ig-size` looks the same. `--size` and `--ig-splitter-size` still set the small size, and the medium and large steps add to it. A `--border-radius` or `--ig-splitter-border-radius` that you set applies at every size. The 48px gap around the drag handle is measured from the icon box of the design, so each expander is 5px further from the handle than before at the default size, 3px in the Indigo theme. The area of an expander that takes the pointer is that icon box, centered on the arrow: 18px, 20px or 24px square, 14px, 16px or 24px in the Indigo theme. Previously it was 16px by 12px at the default size in every theme. In the Indigo theme the idle bar is 1px, 4px or 8px thick by size, also with an overridden size, where the 1px was thicker before (2px for `--ig-splitter-size: 10px`), and the area around the bar that takes the pointer grows with the bar. Previously the splitter had one size, so an app that sets `--ig-size` to medium or large on the splitter or on an ancestor now gets a thicker bar (#18013). + - The splitter follows `--ig-size`. The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px with a 2px, 8px or 8px radius, and the expanders grow with them. The default is small, which is the size from before, so a splitter without `--ig-size` looks the same. `--size` and `--ig-splitter-size` still set the small size, and the medium and large steps add to it. A `--border-radius` or `--ig-splitter-border-radius` that you set applies at every size. In the Indigo theme the idle bar is 1px, 4px or 8px thick by size, and the area around the bar that takes the pointer grows with the bar (#18013). ```html ... ```