From 9ecad8236f104d163800070b6fb70634ddafd378 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Thu, 19 Nov 2026 15:57:00 +0200 Subject: [PATCH 1/9] 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 `--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. --- CHANGELOG.md | 4 + src/components/splitter/spec.md | 38 ++++ src/components/splitter/splitter.spec.ts | 190 ++++++++++++++++++ .../themes/shared/splitter.common.scss | 36 +++- .../themes/shared/splitter.indigo.scss | 8 +- .../splitter/themes/splitter.base.scss | 6 +- 6 files changed, 267 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4157f8147..c0c510bc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - `dot-style`, `square-style` and `corner-dot-style` take `squircle`, a square with soft corners. - `corner-dot-style` sets the shape of the inner corner dots. When you do not set it, the inner corner dots use `dot-style`, as before. - `dot-scale` sets the size of the data modules, from 0.7 to 1 of their cell, to leave a gap between them. The corners keep their full size. +- #### Splitter + - 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. `--ig-splitter-size` still sets the small size, and the medium and large steps add to it. A `--ig-splitter-border-radius` that you set applies at every size. Before, 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. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) ### Changed - #### Combo @@ -91,6 +93,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Tab on the open list without an active option no longer clears a `value` that matches no option yet, for example one whose option a framework renders later. - #### Slider - A change of the user that fails validation shows the invalid styles at once. +- #### Splitter + - 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. Before, the gaps stayed 48px, so the handle shrank and the expanders touched the ends of the bar. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) ## [7.5.0] - 2026-11-16 ### Added diff --git a/src/components/splitter/spec.md b/src/components/splitter/spec.md index f0d7d80c4..c0f259ef1 100644 --- a/src/components/splitter/spec.md +++ b/src/components/splitter/spec.md @@ -16,6 +16,7 @@ - [Setting size constraints](#setting-size-constraints) - [Disabling user interactions](#disabling-user-interactions) - [Customizing visual elements](#customizing-visual-elements) + - [Sizing](#sizing) - [Programmatic control](#programmatic-control) - [Nested splitters](#nested-splitters) - [Localization](#localization) @@ -44,6 +45,7 @@ - [Localization](#localization-1) - [Hidden ancestor](#hidden-ancestor) - [Orientation change in a theme](#orientation-change-in-a-theme) + - [Sizing](#sizing-1) - [Accessibility](#accessibility) - [ARIA roles and properties](#aria-roles-and-properties) - [Keyboard support](#keyboard-support) @@ -60,6 +62,7 @@ | 5 | 2026-10-23 | The splitter makes a stacking context, so the z-index of the focused bar does not compete with the layers of the page | | 6 | 2026-10-29 | Transition only the colors, the shadow and the scale of the bar, so the bar hides at the same time as a hidden ancestor and takes its new size, and in the Indigo theme its new scale, at once after an orientation change | | 7 | 2026-11-02 | Each pane makes a stacking context, so the focused bar stays above slotted content with any `z-index` | +| 8 | 2026-11-19 | The bar, the drag handle and the expanders follow `--ig-size`, with small as the default. A short bar narrows the gaps around the drag handle, not the handle | ## Overview @@ -233,6 +236,28 @@ any other unitless or unparsable value, a negative value, or a percentage above The collapse buttons are additionally hidden while a pane is collapsed. +#### Sizing + +```html +... +``` + +The splitter has no size property. It follows `--ig-size`, set on the element or on an ancestor. The default is +small. + +| 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. + +The drag handle is 25% of the bar length at every size, with 48px between it and each expander. On a bar too short +for that, the gaps get narrower and the handle keeps its 25%. In the Indigo theme the idle bar is 1px thick at every size +and takes the thickness of the size on hover and focus. + #### Programmatic control ```typescript @@ -496,6 +521,19 @@ with `@open-wc/testing` fixtures and assertions. The groups below mirror the `de 36. In the Indigo theme, the bar takes the scale of a new orientation at once, with no transition. +### Sizing + +37. Without `--ig-size` the bar is 6px thick, the drag handle 4px with a 2px radius and the expanders 8px wide. +38. At medium and large the bar is 12px and 18px thick, the drag handle 6px and 8px with an 8px radius, centered on + the bar, and the expanders 10px and 12px wide. +39. An overridden `--ig-splitter-size` adds the same amount to the bar, the drag handle and the expanders at every + size. +40. With a collapsed pane, the drag handle keeps its 48px margins and its position. +41. On a short bar the drag handle keeps 25% of the bar length, the gaps to the expanders get narrower and the + expanders stay inside the bar. +42. In the Indigo theme, the idle bar is 1px thick at every size, also with an overridden `--ig-splitter-size`. +43. In the Indigo theme, the hovered bar has the thickness of the size. + ## Accessibility ### ARIA roles and properties diff --git a/src/components/splitter/splitter.spec.ts b/src/components/splitter/splitter.spec.ts index f16dde600..68d7716d8 100644 --- a/src/components/splitter/splitter.spec.ts +++ b/src/components/splitter/splitter.spec.ts @@ -4031,6 +4031,196 @@ describe('Splitter', () => { }); }); + describe('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 }, + ]; + + function measure(target: IgcSplitterComponent) { + const horizontal = target.orientation === 'horizontal'; + const extent = horizontal ? 'width' : 'height'; + const length = horizontal ? 'height' : 'width'; + const start = horizontal ? 'left' : 'top'; + const center = (rect: DOMRect) => rect[start] + rect[extent] / 2; + const bar = getSplitterPart(target, BAR_PART).getBoundingClientRect(); + const handle = getSplitterPart( + target, + DRAG_HANDLE_PART + ).getBoundingClientRect(); + const expander = + getButtonParts(target).startCollapseBtn.getBoundingClientRect(); + + return { + bar: bar[extent], + barLength: bar[length], + handle: handle[extent], + handleLength: handle[length], + expanderBase: expander[length], + handleOffset: center(handle) - center(bar), + handleRadius: getComputedStyle( + getSplitterPart(target, DRAG_HANDLE_PART) + ).borderRadius, + }; + } + + it('renders the small size without --ig-size', () => { + const { bar, handle, expanderBase, handleRadius } = measure(splitter); + + expect(bar).to.equal(6); + expect(handle).to.equal(4); + expect(handleRadius).to.equal('2px'); + expect(expanderBase).to.equal(8); + }); + + it('sizes the bar, the drag handle and the expanders at medium and large', async () => { + for (const step of steps.slice(1)) { + splitter.style.setProperty('--ig-size', step.value); + await elementUpdated(splitter); + + const { bar, handle, expanderBase, handleOffset, handleRadius } = + measure(splitter); + + expect(bar, step.size).to.equal(step.bar); + expect(handle, step.size).to.equal(step.handle); + expect(expanderBase, step.size).to.equal(step.expander * 2); + expect(handleOffset, step.size).to.equal(0); + expect(handleRadius, step.size).to.equal(`${step.radius}px`); + } + }); + + it('adds each step to an overridden --ig-splitter-size', async () => { + splitter.style.setProperty('--ig-splitter-size', '10px'); + + for (const step of steps) { + splitter.style.setProperty('--ig-size', step.value); + await elementUpdated(splitter); + + const { bar, handle, expanderBase } = measure(splitter); + + // 6px more than the default 4px size at every step. + expect(bar, step.size).to.equal(step.bar + 6); + expect(handle, step.size).to.equal(step.handle + 6); + expect(expanderBase, step.size).to.equal((step.expander + 6) * 2); + } + }); + + function gaps(target: IgcSplitterComponent) { + const { startCollapseBtn, endCollapseBtn } = getButtonParts(target); + const bar = getSplitterPart(target, BAR_PART).getBoundingClientRect(); + const handle = getSplitterPart( + target, + DRAG_HANDLE_PART + ).getBoundingClientRect(); + const start = startCollapseBtn.getBoundingClientRect(); + const end = endCollapseBtn.getBoundingClientRect(); + + return { + handleGaps: [handle.top - start.bottom, end.top - handle.bottom], + buttonsGap: end.top - start.bottom, + inside: start.top >= bar.top && end.bottom <= bar.bottom, + }; + } + + it('keeps the drag handle 48px from the bar content edge with a collapsed pane', async () => { + const handleTop = () => + getSplitterPart(splitter, DRAG_HANDLE_PART).getBoundingClientRect() + .top - + getSplitterPart(splitter, BAR_PART).getBoundingClientRect().top; + // The handle, its two 48px margins and the one expander that is left, centered in the 500px bar. + const groupStart = (500 - (125 + 96 + 8)) / 2; + + splitter.toggle('start'); + await elementUpdated(splitter); + expect(handleTop()).to.equal(groupStart + 48); + + splitter.toggle('start'); + splitter.toggle('end'); + await elementUpdated(splitter); + expect(handleTop()).to.equal(groupStart + 8 + 48); + }); + + it('keeps the drag handle at 25% of a short bar and narrows the gaps, at every size', async () => { + splitter.style.height = '128px'; + + for (const step of steps) { + splitter.style.setProperty('--ig-size', step.value); + await elementUpdated(splitter); + + const { handleLength } = measure(splitter); + const { handleGaps, inside } = gaps(splitter); + // What the bar leaves after the handle and the two expanders, halved. + const gap = (128 - 32 - step.expander * 4) / 2; + + expect(handleLength, step.size).to.equal(32); + expect(handleGaps, step.size).to.eql([gap, gap]); + expect(inside, step.size).to.be.true; + } + }); + + it('keeps a 1px idle bar at every size and with an overridden size in indigo', async () => { + await withDocumentSheets([indigo.styleSheet!], async () => { + try { + configureTheme('indigo'); + await elementUpdated(splitter); + + for (const step of steps) { + splitter.style.setProperty('--ig-size', step.value); + await elementUpdated(splitter); + await nextFrame(); + finishAnimationsFor(splitter.shadowRoot!); + + expect(measure(splitter).bar, step.size).to.be.closeTo(1, 0.01); + } + + splitter.style.setProperty('--ig-splitter-size', '10px'); + await elementUpdated(splitter); + await nextFrame(); + finishAnimationsFor(splitter.shadowRoot!); + + expect(measure(splitter).bar, 'overridden size').to.be.closeTo( + 1, + 0.01 + ); + } finally { + configureTheme('bootstrap'); + } + }); + }); + + it('shows the full bar thickness on hover at every size in indigo', async () => { + await withDocumentSheets([indigo.styleSheet!], async () => { + try { + configureTheme('indigo'); + await elementUpdated(splitter); + await sendMouse({ + type: 'move', + position: getCenter(getSplitterPart(splitter, BAR_PART)), + }); + + for (const step of steps) { + splitter.style.setProperty('--ig-size', step.value); + await elementUpdated(splitter); + await nextFrame(); + finishAnimationsFor(splitter.shadowRoot!); + + expect(measure(splitter).bar, step.size).to.equal(step.bar); + } + } finally { + configureTheme('bootstrap'); + } + }); + }); + }); + runHiddenAncestorTests(html`
Start
diff --git a/src/components/splitter/themes/shared/splitter.common.scss b/src/components/splitter/themes/shared/splitter.common.scss index f9fa43caa..fc0199307 100644 --- a/src/components/splitter/themes/shared/splitter.common.scss +++ b/src/components/splitter/themes/shared/splitter.common.scss @@ -4,9 +4,22 @@ $theme: $material; $splitter-color: var-get($theme, 'bar-color'); -$bar-size: var-get($theme, 'size'); -$expander-border: $bar-size solid var-get($theme, 'expander-color'); -$expander-border-active: $bar-size solid var-get($theme, 'expander-color-active'); +$size: var-get($theme, 'size'); +$bar-size: var(--_bar-size); +$handle-size: var(--_handle-size); +$expander-size: var(--_expander-size); +$expander-border: $expander-size solid var-get($theme, 'expander-color'); +$expander-border-active: $expander-size solid var-get($theme, 'expander-color-active'); + +:host { + --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 igx-splitter block in igniteui-angular. + --_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)}))}; +} [part~='splitter-bar'] { background: hsla(from $splitter-color h s l / 68%); @@ -68,11 +81,17 @@ $expander-border-active: $bar-size solid var-get($theme, 'expander-color-active' } // `$main` is the axis of the bar thickness, `$cross` the axis of its length. -@each $orientation, $extent, $main, $cross in (horizontal, width, inline, block), (vertical, height, block, inline) { +// `$bar-percent` is 1% of the bar length: a container query unit, with the bar as the size container. +@each $orientation, $extent, $main, $cross, $bar-percent in (horizontal, width, inline, block, 1cqb), (vertical, height, block, inline, 1cqi) { + $handle-length: 25 * $bar-percent; + + // The room for one margin when the bar is too short for 48px: + // half of what the handle leaves, less one expander. + $room: calc((#{100 * $bar-percent} - #{$handle-length}) / 2 - 2 * #{$expander-size}); + :host([orientation='#{$orientation}']) { [part~='splitter-bar'] { #{$extent}: $bar-size; - padding-#{$main}: rem(1px); &:active { [part~='start-expand-btn'], @@ -88,13 +107,14 @@ $expander-border-active: $bar-size solid var-get($theme, 'expander-color-active' } [part~='drag-handle'] { - #{$extent}: $bar-size; + #{$extent}: $handle-size; + margin-#{$cross}: clamp(0px, #{$room}, #{rem(48px)}); } [part*='collapse-btn'], [part*='expand-btn'] { - border-#{$cross}-start: $bar-size solid transparent; - border-#{$cross}-end: $bar-size solid transparent; + border-#{$cross}-start: $expander-size solid transparent; + border-#{$cross}-end: $expander-size solid transparent; } [part~='start-expand-btn'], diff --git a/src/components/splitter/themes/shared/splitter.indigo.scss b/src/components/splitter/themes/shared/splitter.indigo.scss index 3374d207e..082e6b4fa 100644 --- a/src/components/splitter/themes/shared/splitter.indigo.scss +++ b/src/components/splitter/themes/shared/splitter.indigo.scss @@ -1,14 +1,12 @@ -@use 'sass:map'; -@use 'igniteui-theming/sass/utils/math' as theming-math; @use 'igniteui-theming/sass/animations/easings' as *; @use 'styles/utilities' as *; @use '../light/themes' as *; $theme: $indigo; -// The bar size in pixels, with its 1px padding on each side. -$splitter-size: theming-math.unitless(px(map.get($theme, 'size'))) + 2; -$slim-splitter: calc( 1 / $splitter-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, var(--_bar-size))); %hide-controls { [part~='drag-handle'], diff --git a/src/components/splitter/themes/splitter.base.scss b/src/components/splitter/themes/splitter.base.scss index 57959d27f..87b59a7dc 100644 --- a/src/components/splitter/themes/splitter.base.scss +++ b/src/components/splitter/themes/splitter.base.scss @@ -41,8 +41,12 @@ display: flex; flex-shrink: 0; justify-content: center; + align-items: center; box-sizing: content-box; + // Gives the drag handle the bar length, as container query units. + container-type: size; + [part*='collapse-btn'], [part*='expand-btn'] { cursor: pointer; @@ -65,7 +69,6 @@ [part~='drag-handle'] { height: 25%; - margin: rem(48px) 0; } } @@ -82,7 +85,6 @@ [part~='drag-handle'] { width: 25%; - margin: 0 rem(48px); } } From 816c138b81b8714311d685abe2d5169bf867cba7 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Thu, 19 Nov 2026 18:30:55 +0200 Subject: [PATCH 2/9] fix(splitter): keep the pane constraints and the expanders in step with 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. --- CHANGELOG.md | 1 + src/components/splitter/spec.md | 23 ++- src/components/splitter/splitter.spec.ts | 144 ++++++++++++++---- src/components/splitter/splitter.ts | 30 ++-- .../themes/shared/splitter.common.scss | 7 + .../splitter/themes/splitter.base.scss | 14 -- 6 files changed, 161 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0c510bc5..79a5a0639 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,6 +95,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - A change of the user that fails validation shows the invalid styles at once. - #### Splitter - 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. Before, the gaps stayed 48px, so the handle shrank and the expanders touched the ends of the bar. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) + - In the Indigo theme, the minimum sizes of the panes count the full thickness of the bar while it is idle. Before, they counted the 1px that the idle bar shows, so two minimums that filled the splitter overflowed it. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) ## [7.5.0] - 2026-11-16 ### Added diff --git a/src/components/splitter/spec.md b/src/components/splitter/spec.md index c0f259ef1..5c5d44595 100644 --- a/src/components/splitter/spec.md +++ b/src/components/splitter/spec.md @@ -255,8 +255,11 @@ The steps add to the `size` theme token (4px), so `--ig-splitter-size: 10px` mak the drag handle 10px, 12px and 14px. The drag handle is 25% of the bar length at every size, with 48px between it and each expander. On a bar too short -for that, the gaps get narrower and the handle keeps its 25%. In the Indigo theme the idle bar is 1px thick at every size -and takes the thickness of the size on hover and focus. +for that, the gaps get narrower and the handle keeps its 25%. Without a drag handle the two expanders are 48px +apart, or closer on a bar too short for that. In the Indigo theme the idle bar is 1px thick at every size and takes +the thickness of the size on hover and focus. + +A change of `--ig-size` updates the pane constraints: the panes share what the new bar thickness leaves. #### Programmatic control @@ -524,15 +527,19 @@ with `@open-wc/testing` fixtures and assertions. The groups below mirror the `de ### Sizing 37. Without `--ig-size` the bar is 6px thick, the drag handle 4px with a 2px radius and the expanders 8px wide. -38. At medium and large the bar is 12px and 18px thick, the drag handle 6px and 8px with an 8px radius, centered on - the bar, and the expanders 10px and 12px wide. +38. At medium and large, in both orientations, the bar is 12px and 18px thick, the drag handle 6px and 8px with an + 8px radius, centered on the bar, and the expanders 10px and 12px wide. 39. An overridden `--ig-splitter-size` adds the same amount to the bar, the drag handle and the expanders at every size. 40. With a collapsed pane, the drag handle keeps its 48px margins and its position. -41. On a short bar the drag handle keeps 25% of the bar length, the gaps to the expanders get narrower and the - expanders stay inside the bar. -42. In the Indigo theme, the idle bar is 1px thick at every size, also with an overridden `--ig-splitter-size`. -43. In the Indigo theme, the hovered bar has the thickness of the size. +41. On a short bar, at every size and in both orientations, the drag handle keeps 25% of the bar length, the gaps to + the expanders get narrower and the expanders stay inside the bar. +42. Without a drag handle the expanders are 48px apart, and on a bar too short for that they stay inside the bar. +43. A size that makes the bar thicker drops the minimum sizes that no longer fit beside it. +44. In the Indigo theme, the idle bar is 1px thick at every size and in both orientations, also with an overridden + `--ig-splitter-size`. +45. In the Indigo theme, the panes give up the full thickness of the bar while the idle bar is 1px. +46. In the Indigo theme, the hovered bar has the thickness of the size. ## Accessibility diff --git a/src/components/splitter/splitter.spec.ts b/src/components/splitter/splitter.spec.ts index 68d7716d8..a67d1dd03 100644 --- a/src/components/splitter/splitter.spec.ts +++ b/src/components/splitter/splitter.spec.ts @@ -4032,6 +4032,7 @@ describe('Splitter', () => { }); describe('Sizing', () => { + const orientations = ['horizontal', 'vertical'] as const; const steps = [ { size: 'small', value: '1', bar: 6, handle: 4, expander: 4, radius: 2 }, { @@ -4081,19 +4082,24 @@ describe('Splitter', () => { expect(expanderBase).to.equal(8); }); - it('sizes the bar, the drag handle and the expanders at medium and large', async () => { - for (const step of steps.slice(1)) { - splitter.style.setProperty('--ig-size', step.value); - await elementUpdated(splitter); + it('sizes the bar, the drag handle and the expanders at medium and large, in both orientations', async () => { + for (const orientation of orientations) { + splitter.orientation = orientation; + + for (const step of steps.slice(1)) { + const label = `${orientation} ${step.size}`; + splitter.style.setProperty('--ig-size', step.value); + await elementUpdated(splitter); - const { bar, handle, expanderBase, handleOffset, handleRadius } = - measure(splitter); + const { bar, handle, expanderBase, handleOffset, handleRadius } = + measure(splitter); - expect(bar, step.size).to.equal(step.bar); - expect(handle, step.size).to.equal(step.handle); - expect(expanderBase, step.size).to.equal(step.expander * 2); - expect(handleOffset, step.size).to.equal(0); - expect(handleRadius, step.size).to.equal(`${step.radius}px`); + expect(bar, label).to.equal(step.bar); + expect(handle, label).to.equal(step.handle); + expect(expanderBase, label).to.equal(step.expander * 2); + expect(handleOffset, label).to.equal(0); + expect(handleRadius, label).to.equal(`${step.radius}px`); + } } }); @@ -4122,15 +4128,20 @@ describe('Splitter', () => { ).getBoundingClientRect(); const start = startCollapseBtn.getBoundingClientRect(); const end = endCollapseBtn.getBoundingClientRect(); + // The edges on the axis of the bar length. + const [near, far] = + target.orientation === 'horizontal' + ? (['top', 'bottom'] as const) + : (['left', 'right'] as const); return { - handleGaps: [handle.top - start.bottom, end.top - handle.bottom], - buttonsGap: end.top - start.bottom, - inside: start.top >= bar.top && end.bottom <= bar.bottom, + handleGaps: [handle[near] - start[far], end[near] - handle[far]], + buttonsGap: end[near] - start[far], + inside: start[near] >= bar[near] && end[far] <= bar[far], }; } - it('keeps the drag handle 48px from the bar content edge with a collapsed pane', async () => { + it('keeps the 48px margins around the drag handle with a collapsed pane', async () => { const handleTop = () => getSplitterPart(splitter, DRAG_HANDLE_PART).getBoundingClientRect() .top - @@ -4148,24 +4159,74 @@ describe('Splitter', () => { expect(handleTop()).to.equal(groupStart + 8 + 48); }); - it('keeps the drag handle at 25% of a short bar and narrows the gaps, at every size', async () => { - splitter.style.height = '128px'; + it('keeps the drag handle at 25% of a short bar and narrows the gaps, at every size and in both orientations', async () => { + for (const orientation of orientations) { + splitter.orientation = orientation; + splitter.style.width = orientation === 'vertical' ? '128px' : '500px'; + splitter.style.height = + orientation === 'horizontal' ? '128px' : '500px'; - for (const step of steps) { - splitter.style.setProperty('--ig-size', step.value); + for (const step of steps) { + const label = `${orientation} ${step.size}`; + splitter.style.setProperty('--ig-size', step.value); + await elementUpdated(splitter); + + const { handleLength } = measure(splitter); + const { handleGaps, inside } = gaps(splitter); + // What the bar leaves after the handle and the two expanders, halved. + const gap = (128 - 32 - step.expander * 4) / 2; + + expect(handleLength, label).to.equal(32); + expect(handleGaps, label).to.eql([gap, gap]); + expect(inside, label).to.be.true; + } + } + }); + + it('keeps the expanders 48px apart without a drag handle and inside a bar too short for it', async () => { + splitter.hideDragHandle = true; + splitter.style.setProperty('--ig-size', '3'); + + for (const orientation of orientations) { + const length = orientation === 'horizontal' ? 'height' : 'width'; + splitter.orientation = orientation; + + splitter.style[length] = '500px'; + await elementUpdated(splitter); + expect(gaps(splitter).buttonsGap, orientation).to.equal(48); + + // The two 12px expanders leave 44px of the bar. + splitter.style[length] = '68px'; await elementUpdated(splitter); - const { handleLength } = measure(splitter); - const { handleGaps, inside } = gaps(splitter); - // What the bar leaves after the handle and the two expanders, halved. - const gap = (128 - 32 - step.expander * 4) / 2; + const { buttonsGap, inside } = gaps(splitter); + expect(buttonsGap, orientation).to.equal(44); + expect(inside, orientation).to.be.true; - expect(handleLength, step.size).to.equal(32); - expect(handleGaps, step.size).to.eql([gap, gap]); - expect(inside, step.size).to.be.true; + splitter.style[length] = '500px'; } }); + // A resize observer reports after the animation frame callbacks of its frame. + async function observerReport() { + await nextFrame(); + await nextFrame(); + await elementUpdated(splitter); + } + + it('drops the minimum sizes that no longer fit when the size makes the bar thicker', async () => { + // 490px of minimums fit beside the 6px bar, and not beside the 18px one. + splitter.startMinSize = '245px'; + splitter.endMinSize = '245px'; + await observerReport(); + + splitter.style.setProperty('--ig-size', '3'); + await observerReport(); + + const { startSize, endSize } = getPanesSizes(splitter, 'width'); + expect(startSize + endSize).to.equal(500 - 18); + }); + it('keeps a 1px idle bar at every size and with an overridden size in indigo', async () => { await withDocumentSheets([indigo.styleSheet!], async () => { try { @@ -4181,6 +4242,13 @@ describe('Splitter', () => { expect(measure(splitter).bar, step.size).to.be.closeTo(1, 0.01); } + splitter.orientation = 'vertical'; + await elementUpdated(splitter); + await nextFrame(); + finishAnimationsFor(splitter.shadowRoot!); + + expect(measure(splitter).bar, 'vertical').to.be.closeTo(1, 0.01); + splitter.style.setProperty('--ig-splitter-size', '10px'); await elementUpdated(splitter); await nextFrame(); @@ -4196,6 +4264,30 @@ describe('Splitter', () => { }); }); + it('takes the full bar thickness from the panes while the idle bar is 1px in indigo', async () => { + await withDocumentSheets([indigo.styleSheet!], async () => { + try { + configureTheme('indigo'); + splitter.style.setProperty('--ig-size', '3'); + await elementUpdated(splitter); + await nextFrame(); + finishAnimationsFor(splitter.shadowRoot!); + + // 488px of minimums do not fit beside the 18px bar. + splitter.startMinSize = '244px'; + splitter.endMinSize = '244px'; + await elementUpdated(splitter); + + const { startSize, endSize } = getPanesSizes(splitter, 'width'); + + expect(measure(splitter).bar).to.be.closeTo(1, 0.01); + expect(startSize + endSize).to.equal(500 - 18); + } finally { + configureTheme('bootstrap'); + } + }); + }); + it('shows the full bar thickness on hover at every size in indigo', async () => { await withDocumentSheets([indigo.styleSheet!], async () => { try { diff --git a/src/components/splitter/splitter.ts b/src/components/splitter/splitter.ts index a440e3b4e..5b534991b 100644 --- a/src/components/splitter/splitter.ts +++ b/src/components/splitter/splitter.ts @@ -219,8 +219,12 @@ export default class IgcSplitterComponent extends I18nMixin( private _measurement: { container: number; bar: number } | null = null; - /** Container extent at the last handled resize. */ - private _observedSize = -1; + private readonly _resizeObserver: ReturnType< + typeof addResizeObserverController + >; + + /** Container and bar extents at the last handled resize. */ + private _observed = { container: -1, bar: -1 }; @query('[part~="base"]') private readonly _base!: HTMLElement; @@ -440,7 +444,7 @@ export default class IgcSplitterComponent extends I18nMixin( addSlotController(this, { slots: Slots }); - addResizeObserverController(this, { + this._resizeObserver = addResizeObserverController(this, { callback: this._handleContainerResize, }); @@ -479,6 +483,11 @@ export default class IgcSplitterComponent extends I18nMixin( } } + protected override firstUpdated(): void { + // The bar thickness follows `--ig-size` and changes without a host resize. + this._resizeObserver.observe(this._separator!); + } + protected override update(changed: PropertyValues): void { this._clearMeasurement(); this._updatePanes(); @@ -548,10 +557,10 @@ export default class IgcSplitterComponent extends I18nMixin( private _handleContainerResize(): void { this._measurement = null; - const size = this._getContainerSize(); + const { container, bar } = this._measure(); - if (size !== this._observedSize) { - this._observedSize = size; + if (container !== this._observed.container || bar !== this._observed.bar) { + this._observed = { container, bar }; this.requestUpdate(); } } @@ -958,13 +967,14 @@ export default class IgcSplitterComponent extends I18nMixin( * between the reads would force a reflow for each read. */ private _measure(): { container: number; bar: number } { - const axis = this._isHorizontal ? 'width' : 'height'; + const [axis, offset] = this._isHorizontal + ? (['width', 'offsetWidth'] as const) + : (['height', 'offsetHeight'] as const); this._measurement ??= { container: this._base ? this._base.getBoundingClientRect()[axis] : 0, - bar: this._separator - ? roundPrecise(this._separator.getBoundingClientRect()[axis]) - : 0, + // The layout extent, which a theme transform does not change. + bar: this._separator?.[offset] ?? 0, }; return this._measurement; diff --git a/src/components/splitter/themes/shared/splitter.common.scss b/src/components/splitter/themes/shared/splitter.common.scss index fc0199307..4e643dfd0 100644 --- a/src/components/splitter/themes/shared/splitter.common.scss +++ b/src/components/splitter/themes/shared/splitter.common.scss @@ -89,6 +89,13 @@ $expander-border-active: $expander-size solid var-get($theme, 'expander-color-ac // half of what the handle leaves, less one expander. $room: calc((#{100 * $bar-percent} - #{$handle-length}) / 2 - 2 * #{$expander-size}); + // The gap between the two expanders when the drag handle is hidden: what they leave of the bar, up to 48px. + :host([orientation='#{$orientation}']:is([disable-resize], [hide-drag-handle])) { + [part~='start-collapse-btn'] { + margin-#{$cross}-end: clamp(0px, calc(#{100 * $bar-percent} - 4 * #{$expander-size}), #{rem(48px)}); + } + } + :host([orientation='#{$orientation}']) { [part~='splitter-bar'] { #{$extent}: $bar-size; diff --git a/src/components/splitter/themes/splitter.base.scss b/src/components/splitter/themes/splitter.base.scss index 87b59a7dc..810736805 100644 --- a/src/components/splitter/themes/splitter.base.scss +++ b/src/components/splitter/themes/splitter.base.scss @@ -106,20 +106,6 @@ } } -:host([disable-resize][orientation='horizontal']), -:host([hide-drag-handle][orientation='horizontal']) { - [part~='start-collapse-btn'] { - margin-block-end: rem(48px); - } -} - -:host([disable-resize][orientation='vertical']), -:host([hide-drag-handle][orientation='vertical']) { - [part~='start-collapse-btn'] { - margin-inline-end: rem(48px); - } -} - @media (forced-colors: active) { [part~='splitter-bar'] { border: rem(1px) solid CanvasText; From 36137a64ed17a778b0c30dd1b634251f25dd1d68 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Fri, 20 Nov 2026 11:28:22 +0200 Subject: [PATCH 3/9] fix(splitter): measure the bar without its own scale, in the coordinates 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. --- src/components/splitter/spec.md | 10 +++++---- src/components/splitter/splitter.spec.ts | 27 ++++++++++++++++++++++++ src/components/splitter/splitter.ts | 25 +++++++++++++++++----- 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/src/components/splitter/spec.md b/src/components/splitter/spec.md index 5c5d44595..92713acd4 100644 --- a/src/components/splitter/spec.md +++ b/src/components/splitter/spec.md @@ -536,10 +536,12 @@ with `@open-wc/testing` fixtures and assertions. The groups below mirror the `de the expanders get narrower and the expanders stay inside the bar. 42. Without a drag handle the expanders are 48px apart, and on a bar too short for that they stay inside the bar. 43. A size that makes the bar thicker drops the minimum sizes that no longer fit beside it. -44. In the Indigo theme, the idle bar is 1px thick at every size and in both orientations, also with an overridden - `--ig-splitter-size`. -45. In the Indigo theme, the panes give up the full thickness of the bar while the idle bar is 1px. -46. In the Indigo theme, the hovered bar has the thickness of the size. +44. A fractional bar thickness counts in full against the minimum sizes. +45. Under a scaled ancestor, the bar thickness counts at the scale of the container. +46. In the Indigo theme, the idle bar is 1px thick at every size, and at large in the vertical orientation, also with + an overridden `--ig-splitter-size`. +47. In the Indigo theme, the panes give up the full thickness of the bar while the idle bar is 1px. +48. In the Indigo theme, the hovered bar has the thickness of the size. ## Accessibility diff --git a/src/components/splitter/splitter.spec.ts b/src/components/splitter/splitter.spec.ts index a67d1dd03..1e11c7977 100644 --- a/src/components/splitter/splitter.spec.ts +++ b/src/components/splitter/splitter.spec.ts @@ -4227,6 +4227,33 @@ describe('Splitter', () => { expect(startSize + endSize).to.equal(500 - 18); }); + it('counts a fractional bar thickness against the minimum sizes', async () => { + // The 6.375px bar leaves 493.625px, less than the 493.75px of minimums. + splitter.style.setProperty('--ig-splitter-size', '4.375px'); + splitter.startMinSize = '246.875px'; + splitter.endMinSize = '246.875px'; + await observerReport(); + + const { startSize, endSize } = getPanesSizes(splitter, 'width'); + expect(startSize + endSize).to.be.closeTo(493.625, 0.05); + }); + + it('measures the bar in the coordinates of a scaled ancestor', async () => { + // 495px of minimums do not fit beside the 6px bar. + splitter.parentElement!.style.transform = 'scale(2)'; + splitter.parentElement!.style.transformOrigin = '0 0'; + splitter.startMinSize = '49.5%'; + splitter.endMinSize = '49.5%'; + await observerReport(); + + try { + const { startSize, endSize } = getPanesSizes(splitter, 'width'); + expect(startSize + endSize).to.equal((500 - 6) * 2); + } finally { + splitter.parentElement!.style.transform = ''; + } + }); + it('keeps a 1px idle bar at every size and with an overridden size in indigo', async () => { await withDocumentSheets([indigo.styleSheet!], async () => { try { diff --git a/src/components/splitter/splitter.ts b/src/components/splitter/splitter.ts index 5b534991b..b9e197898 100644 --- a/src/components/splitter/splitter.ts +++ b/src/components/splitter/splitter.ts @@ -967,19 +967,34 @@ export default class IgcSplitterComponent extends I18nMixin( * between the reads would force a reflow for each read. */ private _measure(): { container: number; bar: number } { - const [axis, offset] = this._isHorizontal - ? (['width', 'offsetWidth'] as const) - : (['height', 'offsetHeight'] as const); + const axis = this._isHorizontal ? 'width' : 'height'; this._measurement ??= { container: this._base ? this._base.getBoundingClientRect()[axis] : 0, - // The layout extent, which a theme transform does not change. - bar: this._separator?.[offset] ?? 0, + bar: this._measureBar(), }; return this._measurement; } + /** The bar extent in the coordinates of the container, without the scale a theme sets on the bar. */ + private _measureBar(): number { + const separator = this._separator; + + if (!separator) { + return 0; + } + + const { a, d } = new DOMMatrixReadOnly( + getComputedStyle(separator).transform + ); + const [extent, scale] = this._isHorizontal + ? [separator.getBoundingClientRect().width, a] + : [separator.getBoundingClientRect().height, d]; + + return roundPrecise(extent / (scale || 1), 3); + } + /** The content box of the flex container - the basis for every percentage. */ private _getContainerSize(): number { return this._measure().container; From 00d04b442b9c050e857f5171e63a7253e2f4e05c Mon Sep 17 00:00:00 2001 From: desig9stein Date: Fri, 20 Nov 2026 15:09:04 +0200 Subject: [PATCH 4/9] fix(splitter): measure the bar from its layout thickness - 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. --- src/components/splitter/spec.md | 7 ++-- src/components/splitter/splitter.spec.ts | 24 +++++++++++++ src/components/splitter/splitter.ts | 43 +++++++++++++++--------- 3 files changed, 55 insertions(+), 19 deletions(-) diff --git a/src/components/splitter/spec.md b/src/components/splitter/spec.md index 92713acd4..a8a8f6d54 100644 --- a/src/components/splitter/spec.md +++ b/src/components/splitter/spec.md @@ -538,10 +538,11 @@ with `@open-wc/testing` fixtures and assertions. The groups below mirror the `de 43. A size that makes the bar thicker drops the minimum sizes that no longer fit beside it. 44. A fractional bar thickness counts in full against the minimum sizes. 45. Under a scaled ancestor, the bar thickness counts at the scale of the container. -46. In the Indigo theme, the idle bar is 1px thick at every size, and at large in the vertical orientation, also with +46. In the Indigo theme, under a rotated ancestor, the minimum sizes that fit beside the idle bar stay applied. +47. In the Indigo theme, the idle bar is 1px thick at every size, and at large in the vertical orientation, also with an overridden `--ig-splitter-size`. -47. In the Indigo theme, the panes give up the full thickness of the bar while the idle bar is 1px. -48. In the Indigo theme, the hovered bar has the thickness of the size. +48. In the Indigo theme, the panes give up the full thickness of the bar while the idle bar is 1px. +49. In the Indigo theme, the hovered bar has the thickness of the size. ## Accessibility diff --git a/src/components/splitter/splitter.spec.ts b/src/components/splitter/splitter.spec.ts index 1e11c7977..1e8a43bf2 100644 --- a/src/components/splitter/splitter.spec.ts +++ b/src/components/splitter/splitter.spec.ts @@ -4254,6 +4254,30 @@ describe('Splitter', () => { } }); + it('keeps the minimum sizes that fit beside the idle bar under a rotated ancestor in indigo', async () => { + await withDocumentSheets([indigo.styleSheet!], async () => { + try { + configureTheme('indigo'); + splitter.parentElement!.style.rotate = '1deg'; + splitter.style.setProperty('--ig-size', '3'); + await elementUpdated(splitter); + await nextFrame(); + finishAnimationsFor(splitter.shadowRoot!); + + // 450px of minimums fit beside the 18px bar. + splitter.startMinSize = '225px'; + splitter.endMinSize = '225px'; + await elementUpdated(splitter); + + const pane = getSplitterPart(splitter, START_PART); + expect(pane.style.minWidth).to.equal('225px'); + } finally { + splitter.parentElement!.style.rotate = ''; + configureTheme('bootstrap'); + } + }); + }); + it('keeps a 1px idle bar at every size and with an overridden size in indigo', async () => { await withDocumentSheets([indigo.styleSheet!], async () => { try { diff --git a/src/components/splitter/splitter.ts b/src/components/splitter/splitter.ts index b9e197898..bfef77e8c 100644 --- a/src/components/splitter/splitter.ts +++ b/src/components/splitter/splitter.ts @@ -967,32 +967,43 @@ export default class IgcSplitterComponent extends I18nMixin( * between the reads would force a reflow for each read. */ private _measure(): { container: number; bar: number } { - const axis = this._isHorizontal ? 'width' : 'height'; + if (!this._measurement) { + const axis = this._isHorizontal ? 'width' : 'height'; + const container = this._base?.getBoundingClientRect()[axis] ?? 0; - this._measurement ??= { - container: this._base ? this._base.getBoundingClientRect()[axis] : 0, - bar: this._measureBar(), - }; + this._measurement = { container, bar: this._measureBar(container) }; + } return this._measurement; } - /** The bar extent in the coordinates of the container, without the scale a theme sets on the bar. */ - private _measureBar(): number { + /** + * The layout thickness of the bar, which no transform changes, at the scale + * of the measured `container`. + */ + private _measureBar(container: number): number { const separator = this._separator; + const layoutContainer = + this._base?.[this._isHorizontal ? 'offsetWidth' : 'offsetHeight']; - if (!separator) { + if (!(separator && layoutContainer)) { return 0; } - const { a, d } = new DOMMatrixReadOnly( - getComputedStyle(separator).transform - ); - const [extent, scale] = this._isHorizontal - ? [separator.getBoundingClientRect().width, a] - : [separator.getBoundingClientRect().height, d]; - - return roundPrecise(extent / (scale || 1), 3); + const style = getComputedStyle(separator); + const [extent, start, end] = this._isHorizontal + ? (['width', 'Left', 'Right'] as const) + : (['height', 'Top', 'Bottom'] as const); + // The bar is a content box. + const thickness = [ + style[extent], + style[`padding${start}`], + style[`padding${end}`], + style[`border${start}Width`], + style[`border${end}Width`], + ].reduce((sum, value) => sum + (Number.parseFloat(value) || 0), 0); + + return roundPrecise((thickness * container) / layoutContainer, 3); } /** The content box of the flex container - the basis for every percentage. */ From 09be5c1f7659f41c98213fa1352e85693562d334 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Sat, 21 Nov 2026 10:20:55 +0200 Subject: [PATCH 5/9] 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 #2634. --- CHANGELOG.md | 4 +- src/components/splitter/spec.md | 8 ++-- src/components/splitter/splitter.spec.ts | 37 +++++++++++++++---- .../themes/shared/splitter.indigo.scss | 7 +++- 4 files changed, 40 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 106630b9b..438d91d21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - `corner-dot-style` sets the shape of the inner corner dots. When you do not set it, the inner corner dots use `dot-style`, as before. - `dot-scale` sets the size of the data modules, from 0.7 to 1 of their cell, to leave a gap between them. The corners keep their full size. - #### Splitter - - 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. `--ig-splitter-size` still sets the small size, and the medium and large steps add to it. A `--ig-splitter-border-radius` that you set applies at every size. Before, 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. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) + - 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. `--ig-splitter-size` still sets the small size, and the medium and large steps add to it. A `--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. Before, 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. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) ### Changed - #### Chip @@ -97,7 +97,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - A change of the user that fails validation shows the invalid styles at once. - #### Splitter - 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. Before, the gaps stayed 48px, so the handle shrank and the expanders touched the ends of the bar. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) - - In the Indigo theme, the minimum sizes of the panes count the full thickness of the bar while it is idle. Before, they counted the 1px that the idle bar shows, so two minimums that filled the splitter overflowed it. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) + - In the Indigo theme, the minimum sizes of the panes count the full thickness of the bar while it is idle. Before, they counted the thickness that the idle bar shows, so two minimums that filled the splitter overflowed it. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) ## [7.5.0] - 2026-11-16 ### Added diff --git a/src/components/splitter/spec.md b/src/components/splitter/spec.md index a8a8f6d54..55d74a865 100644 --- a/src/components/splitter/spec.md +++ b/src/components/splitter/spec.md @@ -256,7 +256,7 @@ the drag handle 10px, 12px and 14px. The drag handle is 25% of the bar length at every size, with 48px between it and each expander. On a bar too short for that, the gaps get narrower and the handle keeps its 25%. Without a drag handle the two expanders are 48px -apart, or closer on a bar too short for that. In the Indigo theme the idle bar is 1px thick at every size and takes +apart, or closer on a bar too short for that. In the Indigo theme the idle bar is 1px, 4px or 8px thick by size and takes the thickness of the size on hover and focus. A change of `--ig-size` updates the pane constraints: the panes share what the new bar thickness leaves. @@ -539,9 +539,9 @@ with `@open-wc/testing` fixtures and assertions. The groups below mirror the `de 44. A fractional bar thickness counts in full against the minimum sizes. 45. Under a scaled ancestor, the bar thickness counts at the scale of the container. 46. In the Indigo theme, under a rotated ancestor, the minimum sizes that fit beside the idle bar stay applied. -47. In the Indigo theme, the idle bar is 1px thick at every size, and at large in the vertical orientation, also with - an overridden `--ig-splitter-size`. -48. In the Indigo theme, the panes give up the full thickness of the bar while the idle bar is 1px. +47. In the Indigo theme, the idle bar is 1px, 4px and 8px thick by size, 8px at large in the vertical orientation and + with an overridden `--ig-splitter-size`. +48. In the Indigo theme, the panes give up the full thickness of the bar while the bar is idle. 49. In the Indigo theme, the hovered bar has the thickness of the size. ## Accessibility diff --git a/src/components/splitter/splitter.spec.ts b/src/components/splitter/splitter.spec.ts index 1e8a43bf2..e0d21466d 100644 --- a/src/components/splitter/splitter.spec.ts +++ b/src/components/splitter/splitter.spec.ts @@ -4033,8 +4033,17 @@ describe('Splitter', () => { describe('Sizing', () => { const orientations = ['horizontal', 'vertical'] as const; + // `idle` is the thickness of the idle bar in indigo. const steps = [ - { size: 'small', value: '1', bar: 6, handle: 4, expander: 4, radius: 2 }, + { + size: 'small', + value: '1', + bar: 6, + handle: 4, + expander: 4, + radius: 2, + idle: 1, + }, { size: 'medium', value: '2', @@ -4042,8 +4051,17 @@ describe('Splitter', () => { handle: 6, expander: 5, radius: 8, + idle: 4, + }, + { + size: 'large', + value: '3', + bar: 18, + handle: 8, + expander: 6, + radius: 8, + idle: 8, }, - { size: 'large', value: '3', bar: 18, handle: 8, expander: 6, radius: 8 }, ]; function measure(target: IgcSplitterComponent) { @@ -4278,7 +4296,7 @@ describe('Splitter', () => { }); }); - it('keeps a 1px idle bar at every size and with an overridden size in indigo', async () => { + it('keeps a 1px, 4px and 8px idle bar by size, also with an overridden size, in indigo', async () => { await withDocumentSheets([indigo.styleSheet!], async () => { try { configureTheme('indigo'); @@ -4290,7 +4308,10 @@ describe('Splitter', () => { await nextFrame(); finishAnimationsFor(splitter.shadowRoot!); - expect(measure(splitter).bar, step.size).to.be.closeTo(1, 0.01); + expect(measure(splitter).bar, step.size).to.be.closeTo( + step.idle, + 0.01 + ); } splitter.orientation = 'vertical'; @@ -4298,7 +4319,7 @@ describe('Splitter', () => { await nextFrame(); finishAnimationsFor(splitter.shadowRoot!); - expect(measure(splitter).bar, 'vertical').to.be.closeTo(1, 0.01); + expect(measure(splitter).bar, 'vertical').to.be.closeTo(8, 0.01); splitter.style.setProperty('--ig-splitter-size', '10px'); await elementUpdated(splitter); @@ -4306,7 +4327,7 @@ describe('Splitter', () => { finishAnimationsFor(splitter.shadowRoot!); expect(measure(splitter).bar, 'overridden size').to.be.closeTo( - 1, + 8, 0.01 ); } finally { @@ -4315,7 +4336,7 @@ describe('Splitter', () => { }); }); - it('takes the full bar thickness from the panes while the idle bar is 1px in indigo', async () => { + it('takes the full bar thickness from the panes while the bar is idle in indigo', async () => { await withDocumentSheets([indigo.styleSheet!], async () => { try { configureTheme('indigo'); @@ -4331,7 +4352,7 @@ describe('Splitter', () => { const { startSize, endSize } = getPanesSizes(splitter, 'width'); - expect(measure(splitter).bar).to.be.closeTo(1, 0.01); + expect(measure(splitter).bar).to.be.closeTo(8, 0.01); expect(startSize + endSize).to.equal(500 - 18); } finally { configureTheme('bootstrap'); diff --git a/src/components/splitter/themes/shared/splitter.indigo.scss b/src/components/splitter/themes/shared/splitter.indigo.scss index 082e6b4fa..0200eb6fd 100644 --- a/src/components/splitter/themes/shared/splitter.indigo.scss +++ b/src/components/splitter/themes/shared/splitter.indigo.scss @@ -4,9 +4,9 @@ $theme: $indigo; -// 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, var(--_bar-size))); +$slim-splitter: tan(atan2(var(--_idle-size), var(--_bar-size))); %hide-controls { [part~='drag-handle'], @@ -29,6 +29,9 @@ $slim-splitter: tan(atan2(1px, var(--_bar-size))); } :host { + // Mirrored by the indigo block of igx-splitter in igniteui-angular. + --_idle-size: #{sizable(rem(1px), rem(4px), rem(8px))}; + [part~='splitter-bar'] { @extend %hide-controls; From 3bb55173af9a4a890d84ea39d44a887451c7b60f Mon Sep 17 00:00:00 2001 From: desig9stein Date: Sat, 21 Nov 2026 10:36:36 +0200 Subject: [PATCH 6/9] feat(splitter): measure the 48px gap from the icon box of the expanders - 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. --- CHANGELOG.md | 2 +- src/components/splitter/spec.md | 29 +++++----- src/components/splitter/splitter.spec.ts | 56 +++++++++++++++---- .../themes/shared/splitter.common.scss | 14 ++++- .../themes/shared/splitter.indigo.scss | 3 + 5 files changed, 78 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 438d91d21..c4f34fceb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - `corner-dot-style` sets the shape of the inner corner dots. When you do not set it, the inner corner dots use `dot-style`, as before. - `dot-scale` sets the size of the data modules, from 0.7 to 1 of their cell, to leave a gap between them. The corners keep their full size. - #### Splitter - - 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. `--ig-splitter-size` still sets the small size, and the medium and large steps add to it. A `--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. Before, 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. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) + - 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. `--ig-splitter-size` still sets the small size, and the medium and large steps add to it. A `--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. 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. Before, 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. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) ### Changed - #### Chip diff --git a/src/components/splitter/spec.md b/src/components/splitter/spec.md index 55d74a865..d2637494b 100644 --- a/src/components/splitter/spec.md +++ b/src/components/splitter/spec.md @@ -254,9 +254,10 @@ small. 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 25% of the bar length at every size, with 48px between it and each expander. On a bar too short -for that, the gaps get narrower and the handle keeps its 25%. Without a drag handle the two expanders are 48px -apart, or closer on a bar too short for that. In the Indigo theme the idle bar is 1px, 4px or 8px thick by size and takes +The drag handle is 25% of the bar length at every size, with 48px between it and the icon box of each expander. The +box is the 18px, 20px and 24px icon of the design (14px, 16px and 24px in the Indigo theme), so the triangle is 5px, +5px and 6px further away (3px, 3px and 6px in Indigo). On a bar too short for that, the gaps get narrower and the +handle keeps its 25%. Without a drag handle the two boxes are 48px apart, or closer on a bar too short for that. In the Indigo theme the idle bar is 1px, 4px or 8px thick by size and takes the thickness of the size on hover and focus. A change of `--ig-size` updates the pane constraints: the panes share what the new bar thickness leaves. @@ -531,18 +532,20 @@ with `@open-wc/testing` fixtures and assertions. The groups below mirror the `de 8px radius, centered on the bar, and the expanders 10px and 12px wide. 39. An overridden `--ig-splitter-size` adds the same amount to the bar, the drag handle and the expanders at every size. -40. With a collapsed pane, the drag handle keeps its 48px margins and its position. -41. On a short bar, at every size and in both orientations, the drag handle keeps 25% of the bar length, the gaps to +40. At every size the drag handle is 48px from the icon box of each expander: 53px, 53px and 54px from the triangle. +41. In the Indigo theme the icon box is smaller: 51px, 51px and 54px from the triangle. +42. With a collapsed pane, the drag handle keeps its 48px margins and its position. +43. On a short bar, at every size and in both orientations, the drag handle keeps 25% of the bar length, the gaps to the expanders get narrower and the expanders stay inside the bar. -42. Without a drag handle the expanders are 48px apart, and on a bar too short for that they stay inside the bar. -43. A size that makes the bar thicker drops the minimum sizes that no longer fit beside it. -44. A fractional bar thickness counts in full against the minimum sizes. -45. Under a scaled ancestor, the bar thickness counts at the scale of the container. -46. In the Indigo theme, under a rotated ancestor, the minimum sizes that fit beside the idle bar stay applied. -47. In the Indigo theme, the idle bar is 1px, 4px and 8px thick by size, 8px at large in the vertical orientation and +44. Without a drag handle the expander boxes are 48px apart, and on a bar too short for that they stay inside the bar. +45. A size that makes the bar thicker drops the minimum sizes that no longer fit beside it. +46. A fractional bar thickness counts in full against the minimum sizes. +47. Under a scaled ancestor, the bar thickness counts at the scale of the container. +48. In the Indigo theme, under a rotated ancestor, the minimum sizes that fit beside the idle bar stay applied. +49. In the Indigo theme, the idle bar is 1px, 4px and 8px thick by size, 8px at large in the vertical orientation and with an overridden `--ig-splitter-size`. -48. In the Indigo theme, the panes give up the full thickness of the bar while the bar is idle. -49. In the Indigo theme, the hovered bar has the thickness of the size. +50. In the Indigo theme, the panes give up the full thickness of the bar while the bar is idle. +51. In the Indigo theme, the hovered bar has the thickness of the size. ## Accessibility diff --git a/src/components/splitter/splitter.spec.ts b/src/components/splitter/splitter.spec.ts index e0d21466d..1349d1909 100644 --- a/src/components/splitter/splitter.spec.ts +++ b/src/components/splitter/splitter.spec.ts @@ -4033,7 +4033,8 @@ describe('Splitter', () => { describe('Sizing', () => { const orientations = ['horizontal', 'vertical'] as const; - // `idle` is the thickness of the idle bar in indigo. + // `space` is the room from a triangle to the edge of the icon box of the design. + // `idle` and `indigoSpace` are the idle bar thickness and that room in indigo. const steps = [ { size: 'small', @@ -4042,7 +4043,9 @@ describe('Splitter', () => { handle: 4, expander: 4, radius: 2, + space: 5, idle: 1, + indigoSpace: 3, }, { size: 'medium', @@ -4051,7 +4054,9 @@ describe('Splitter', () => { handle: 6, expander: 5, radius: 8, + space: 5, idle: 4, + indigoSpace: 3, }, { size: 'large', @@ -4060,7 +4065,9 @@ describe('Splitter', () => { handle: 8, expander: 6, radius: 8, + space: 6, idle: 8, + indigoSpace: 6, }, ]; @@ -4159,13 +4166,41 @@ describe('Splitter', () => { }; } + it('keeps 48px between the drag handle and the icon box of each expander, at every size', async () => { + for (const step of steps) { + splitter.style.setProperty('--ig-size', step.value); + await elementUpdated(splitter); + + const gap = 48 + step.space; + expect(gaps(splitter).handleGaps, step.size).to.eql([gap, gap]); + } + }); + + it('uses the smaller icon box of indigo for the gaps', async () => { + await withDocumentSheets([indigo.styleSheet!], async () => { + try { + configureTheme('indigo'); + + for (const step of steps) { + splitter.style.setProperty('--ig-size', step.value); + await elementUpdated(splitter); + + const gap = 48 + step.indigoSpace; + expect(gaps(splitter).handleGaps, step.size).to.eql([gap, gap]); + } + } finally { + configureTheme('bootstrap'); + } + }); + }); + it('keeps the 48px margins around the drag handle with a collapsed pane', async () => { const handleTop = () => getSplitterPart(splitter, DRAG_HANDLE_PART).getBoundingClientRect() .top - getSplitterPart(splitter, BAR_PART).getBoundingClientRect().top; - // The handle, its two 48px margins and the one expander that is left, centered in the 500px bar. - const groupStart = (500 - (125 + 96 + 8)) / 2; + // The handle, its two 48px margins and the 18px box of the one expander that is left, centered in the 500px bar. + const groupStart = (500 - (125 + 96 + 18)) / 2; splitter.toggle('start'); await elementUpdated(splitter); @@ -4174,7 +4209,7 @@ describe('Splitter', () => { splitter.toggle('start'); splitter.toggle('end'); await elementUpdated(splitter); - expect(handleTop()).to.equal(groupStart + 8 + 48); + expect(handleTop()).to.equal(groupStart + 18 + 48); }); it('keeps the drag handle at 25% of a short bar and narrows the gaps, at every size and in both orientations', async () => { @@ -4191,8 +4226,8 @@ describe('Splitter', () => { const { handleLength } = measure(splitter); const { handleGaps, inside } = gaps(splitter); - // 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, label).to.equal(32); expect(handleGaps, label).to.eql([gap, gap]); @@ -4201,7 +4236,7 @@ describe('Splitter', () => { } }); - it('keeps the expanders 48px apart without a drag handle and inside a bar too short for it', async () => { + it('keeps the expander boxes 48px apart without a drag handle and inside a bar too short for it', async () => { splitter.hideDragHandle = true; splitter.style.setProperty('--ig-size', '3'); @@ -4211,14 +4246,15 @@ describe('Splitter', () => { splitter.style[length] = '500px'; await elementUpdated(splitter); - expect(gaps(splitter).buttonsGap, orientation).to.equal(48); + // 48px between the two icon boxes, and 6px from each box edge to its triangle. + expect(gaps(splitter).buttonsGap, orientation).to.equal(48 + 12); - // The two 12px expanders leave 44px of the bar. + // The two 24px boxes leave 20px of the bar. splitter.style[length] = '68px'; await elementUpdated(splitter); const { buttonsGap, inside } = gaps(splitter); - expect(buttonsGap, orientation).to.equal(44); + expect(buttonsGap, orientation).to.equal(20 + 12); expect(inside, orientation).to.be.true; splitter.style[length] = '500px'; diff --git a/src/components/splitter/themes/shared/splitter.common.scss b/src/components/splitter/themes/shared/splitter.common.scss index 4e643dfd0..8ae040b2f 100644 --- a/src/components/splitter/themes/shared/splitter.common.scss +++ b/src/components/splitter/themes/shared/splitter.common.scss @@ -8,6 +8,10 @@ $size: var-get($theme, 'size'); $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}); $expander-border: $expander-size solid var-get($theme, 'expander-color'); $expander-border-active: $expander-size solid var-get($theme, 'expander-color-active'); @@ -19,6 +23,9 @@ $expander-border-active: $expander-size solid var-get($theme, 'expander-color-ac --_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)}))}; + + // 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))}; } [part~='splitter-bar'] { @@ -87,12 +94,14 @@ $expander-border-active: $expander-size solid var-get($theme, 'expander-color-ac // The room for one margin when the bar is too short for 48px: // half of what the handle leaves, less one expander. - $room: calc((#{100 * $bar-percent} - #{$handle-length}) / 2 - 2 * #{$expander-size}); + $room: calc((#{100 * $bar-percent} - #{$handle-length}) / 2 - #{$expander-box}); // The gap between the two expanders when the drag handle is hidden: what they leave of the bar, up to 48px. :host([orientation='#{$orientation}']:is([disable-resize], [hide-drag-handle])) { [part~='start-collapse-btn'] { - margin-#{$cross}-end: clamp(0px, calc(#{100 * $bar-percent} - 4 * #{$expander-size}), #{rem(48px)}); + margin-#{$cross}-end: calc( + #{$expander-space} + clamp(0px, calc(#{100 * $bar-percent} - 2 * #{$expander-box}), #{rem(48px)}) + ); } } @@ -122,6 +131,7 @@ $expander-border-active: $expander-size solid var-get($theme, 'expander-color-ac [part*='expand-btn'] { border-#{$cross}-start: $expander-size solid transparent; border-#{$cross}-end: $expander-size solid transparent; + margin-#{$cross}: $expander-space; } [part~='start-expand-btn'], diff --git a/src/components/splitter/themes/shared/splitter.indigo.scss b/src/components/splitter/themes/shared/splitter.indigo.scss index 0200eb6fd..2a7208c95 100644 --- a/src/components/splitter/themes/shared/splitter.indigo.scss +++ b/src/components/splitter/themes/shared/splitter.indigo.scss @@ -32,6 +32,9 @@ $slim-splitter: tan(atan2(var(--_idle-size), var(--_bar-size))); // Mirrored by the indigo block of igx-splitter in igniteui-angular. --_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))}; + [part~='splitter-bar'] { @extend %hide-controls; From 229d36ed92b7199a855e02a29145168f51ec8580 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Mon, 23 Nov 2026 16:05:54 +0200 Subject: [PATCH 7/9] 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 nested `sass-embedded` copies under `igniteui-theming` dedupe to the root one. --- package-lock.json | 455 ++-------------------------------------------- package.json | 2 +- 2 files changed, 12 insertions(+), 445 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc357a6fb..a27162ae8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "husky": "^9.1.7", "ig-typedoc-theme": "^7.0.1", "igniteui-i18n-resources": "^2.0.0", - "igniteui-theming": "^30.2.0", + "igniteui-theming": "^30.3.0", "keep-a-changelog": "^3.2.0", "lint-staged": "^17.6.1", "lit-analyzer": "^2.0.3", @@ -5913,13 +5913,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "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/bundle-name": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.1.tgz", @@ -8153,453 +8146,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" - }, - "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, - "libc": "glibc", - "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, - "libc": "glibc", - "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, - "libc": "musl", - "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, - "libc": "musl", - "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, - "libc": "musl", - "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, - "libc": "musl", - "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, - "libc": "glibc", - "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, - "libc": "glibc", - "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" - } - }, - "node_modules/igniteui-theming/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" + "peerDependencies": { + "sass": ">=1.97.1" }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "peerDependenciesMeta": { + "sass": { + "optional": true + } } }, "node_modules/ignore": { diff --git a/package.json b/package.json index 270e64c7e..6e47eecf2 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "husky": "^9.1.7", "ig-typedoc-theme": "^7.0.1", "igniteui-i18n-resources": "^2.0.0", - "igniteui-theming": "^30.2.0", + "igniteui-theming": "^30.3.0", "keep-a-changelog": "^3.2.0", "lint-staged": "^17.6.1", "lit-analyzer": "^2.0.3", From bd8eb21ec1cdccb52963cea844c6c33d68cb8afb Mon Sep 17 00:00:00 2001 From: desig9stein Date: Mon, 23 Nov 2026 16:44:27 +0200 Subject: [PATCH 8/9] 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 the arrow alone, 4px by 8px at small. - The hitbox matches the one of igx-splitter in igniteui-angular. --- CHANGELOG.md | 2 +- src/components/splitter/spec.md | 4 +- src/components/splitter/splitter.spec.ts | 47 +++++++++++++++++++ .../themes/shared/splitter.common.scss | 16 +++++++ .../splitter/themes/splitter.base.scss | 9 ++++ 5 files changed, 76 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f80dc9a1..3515c5afc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - `corner-dot-style` sets the shape of the inner corner dots. When you do not set it, the inner corner dots use `dot-style`, as before. - `dot-scale` sets the size of the data modules, from 0.7 to 1 of their cell, to leave a gap between them. The corners keep their full size. - #### Splitter - - 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. `--ig-splitter-size` still sets the small size, and the medium and large steps add to it. A `--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. 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. Before, 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. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) + - 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. `--ig-splitter-size` still sets the small size, and the medium and large steps add to it. A `--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. 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. Before, it was the arrow alone, 4px by 8px at the default size. Before, 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. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) ### Changed - #### Chip diff --git a/src/components/splitter/spec.md b/src/components/splitter/spec.md index d2637494b..e51a1d344 100644 --- a/src/components/splitter/spec.md +++ b/src/components/splitter/spec.md @@ -256,7 +256,8 @@ the drag handle 10px, 12px and 14px. The drag handle is 25% of the bar length at every size, with 48px between it and the icon box of each expander. The box is the 18px, 20px and 24px icon of the design (14px, 16px and 24px in the Indigo theme), so the triangle is 5px, -5px and 6px further away (3px, 3px and 6px in Indigo). On a bar too short for that, the gaps get narrower and the +5px and 6px further away (3px, 3px and 6px in Indigo). The box, centered on the triangle, is also the area of the +expander that takes the pointer. On a bar too short for that, the gaps get narrower and the handle keeps its 25%. Without a drag handle the two boxes are 48px apart, or closer on a bar too short for that. In the Indigo theme the idle bar is 1px, 4px or 8px thick by size and takes the thickness of the size on hover and focus. @@ -546,6 +547,7 @@ with `@open-wc/testing` fixtures and assertions. The groups below mirror the `de with an overridden `--ig-splitter-size`. 50. In the Indigo theme, the panes give up the full thickness of the bar while the bar is idle. 51. In the Indigo theme, the hovered bar has the thickness of the size. +52. In both orientations and at every size, the hitbox of each expander is its icon box, centered on the triangle. ## Accessibility diff --git a/src/components/splitter/splitter.spec.ts b/src/components/splitter/splitter.spec.ts index 1349d1909..eb11afbbd 100644 --- a/src/components/splitter/splitter.spec.ts +++ b/src/components/splitter/splitter.spec.ts @@ -4176,6 +4176,53 @@ describe('Splitter', () => { } }); + function hitboxes(target: IgcSplitterComponent) { + const { startCollapseBtn, endCollapseBtn } = getButtonParts(target); + const px = (value: string) => Number.parseFloat(value); + + return [startCollapseBtn, endCollapseBtn].map((expander) => { + const border = getComputedStyle(expander); + const box = getComputedStyle(expander, '::before'); + const width = px(box.width); + const height = px(box.height); + + 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('sizes the hitbox of each expander to the icon box and centers it on the triangle, in both orientations', async () => { + // The triangle is a border, which needs its color: the tests load no theme tokens. + splitter.style.setProperty('--expander-color', 'currentColor'); + + for (const orientation of orientations) { + splitter.orientation = orientation; + + for (const step of steps) { + splitter.style.setProperty('--ig-size', step.value); + await elementUpdated(splitter); + + const box = 2 * step.expander + 2 * step.space; + const centered = { width: box, height: box, offsetX: 0, offsetY: 0 }; + expect(hitboxes(splitter), `${step.size} ${orientation}`).to.eql([ + centered, + centered, + ]); + } + } + }); + it('uses the smaller icon box of indigo for the gaps', async () => { await withDocumentSheets([indigo.styleSheet!], async () => { try { diff --git a/src/components/splitter/themes/shared/splitter.common.scss b/src/components/splitter/themes/shared/splitter.common.scss index 8ae040b2f..8ef06f129 100644 --- a/src/components/splitter/themes/shared/splitter.common.scss +++ b/src/components/splitter/themes/shared/splitter.common.scss @@ -132,16 +132,32 @@ $expander-border-active: $expander-size solid var-get($theme, 'expander-color-ac border-#{$cross}-start: $expander-size solid transparent; border-#{$cross}-end: $expander-size solid transparent; margin-#{$cross}: $expander-space; + + // The hitbox is the icon box of the design, centered on the triangle. + // Mirrored by the expander ::before of igx-splitter in igniteui-angular. + &::before { + width: $expander-box; + height: $expander-box; + inset-#{$cross}-start: calc(#{$expander-box} / -2); + } } [part~='start-expand-btn'], [part~='end-collapse-btn'] { border-#{$main}-start: $expander-border; + + &::before { + inset-#{$main}-start: calc((#{$expander-size} + #{$expander-box}) / -2); + } } [part~='start-collapse-btn'], [part~='end-expand-btn'] { border-#{$main}-end: $expander-border; + + &::before { + inset-#{$main}-start: calc((#{$expander-size} - #{$expander-box}) / 2); + } } } } diff --git a/src/components/splitter/themes/splitter.base.scss b/src/components/splitter/themes/splitter.base.scss index 810736805..80dcd8f72 100644 --- a/src/components/splitter/themes/splitter.base.scss +++ b/src/components/splitter/themes/splitter.base.scss @@ -49,9 +49,18 @@ [part*='collapse-btn'], [part*='expand-btn'] { + position: relative; cursor: pointer; width: 0; height: 0; + + &::before { + content: ''; + position: absolute; + + // Keeps the hitbox above the panes. + z-index: 1; + } } } } From ab0ab746416b477462842b93b6239dfe721c3804 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Wed, 25 Nov 2026 13:27:59 +0200 Subject: [PATCH 9/9] docs(splitter): list the default-size changes under Changed - 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()`. --- CHANGELOG.md | 5 ++++- src/components/splitter/spec.md | 5 +++++ src/components/splitter/splitter.ts | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5fe23bb1..f1dcedb5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - `logo-shape` clips the logo to a `circle`, `rounded` or `squircle` shape that fills the logo box. The cutout removes only the modules under the shape. - `createWifiPayload()`, `createVCardPayload()`, `createEpcPayload()` and `createEventPayload()` from `igniteui-webcomponents/extras/qr-payloads` build the value of a code that a phone turns into a Wi-Fi login, a contact card, a SEPA payment or a calendar event. They escape the text and throw a `RangeError` for input that the format does not allow. - #### Splitter - - 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. `--ig-splitter-size` still sets the small size, and the medium and large steps add to it. A `--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. 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. Before, it was the arrow alone, 4px by 8px at the default size. Before, 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. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) + - 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. `--ig-splitter-size` still sets the small size, and the medium and large steps add to it. A `--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. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) ### Changed - #### Accordion, Expansion panel @@ -65,6 +65,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - `checkValidity()` and `reportValidity()` emit `invalid` on the radios of the group in DOM order. Before, the other radios emitted it first, and the called radio last. - #### Select - Tab and Escape on the select act also when other code already called `preventDefault()` on the key, as in the dropdown. Content in the `header` and `footer` slots still keeps a key that it handled. +- #### Splitter + - An app that sets `--ig-size` to medium or large on the splitter or on an ancestor gets a thicker bar. Before, the splitter had one size. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) + - 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. Before, it was the arrow alone, 4px by 8px at the default size. - #### Tabs - The first render shows at once. The selected indicator does not slide in from the start of the strip, and the selected header does not fade in. This also applies when the tabs show later than they render. A selection change after that still animates. diff --git a/src/components/splitter/spec.md b/src/components/splitter/spec.md index e51a1d344..78af46db7 100644 --- a/src/components/splitter/spec.md +++ b/src/components/splitter/spec.md @@ -549,6 +549,11 @@ with `@open-wc/testing` fixtures and assertions. The groups below mirror the `de 51. In the Indigo theme, the hovered bar has the thickness of the size. 52. In both orientations and at every size, the hitbox of each expander is its icon box, centered on the triangle. +## Assumptions and limitations + +- In the Indigo theme, a change of `--ig-size` at run time reaches the idle bar after the 0.5s delay of the bar + transition. Until then the idle bar keeps its old thickness. + ## Accessibility ### ARIA roles and properties diff --git a/src/components/splitter/splitter.ts b/src/components/splitter/splitter.ts index bfef77e8c..2fd2273f7 100644 --- a/src/components/splitter/splitter.ts +++ b/src/components/splitter/splitter.ts @@ -1001,7 +1001,7 @@ export default class IgcSplitterComponent extends I18nMixin( style[`padding${end}`], style[`border${start}Width`], style[`border${end}Width`], - ].reduce((sum, value) => sum + (Number.parseFloat(value) || 0), 0); + ].reduce((sum, value) => sum + asNumber(value), 0); return roundPrecise((thickness * container) / layoutContainer, 3); }