diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cef579b2..335b479eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - `gradient` paints the data modules, the alignment patterns and the corners with a `linear` or `radial` gradient, from `--ig-qr-code-gradient-start` to `--ig-qr-code-gradient-end`. `gradient-angle` turns a linear gradient. An explicit `--ig-qr-code-corner-square-color` or `--ig-qr-code-corner-dot-color` wins for its part. Keep both colors much darker than the background. - `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. [#2634](https://github.com/IgniteUI/igniteui-webcomponents/issues/2634) ### Changed - #### Accordion, Expansion panel @@ -67,6 +69,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. @@ -143,6 +148,9 @@ 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) + - 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/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 2bfd4ff1a..2a2b3584d 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,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", diff --git a/src/components/splitter/spec.md b/src/components/splitter/spec.md index f0d7d80c4..78af46db7 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,33 @@ 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 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). 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. + +A change of `--ig-size` updates the pane constraints: the panes share what the new bar thickness leaves. + #### Programmatic control ```typescript @@ -496,6 +526,34 @@ 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, 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. 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. +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`. +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. + +## 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.spec.ts b/src/components/splitter/splitter.spec.ts index f16dde600..eb11afbbd 100644 --- a/src/components/splitter/splitter.spec.ts +++ b/src/components/splitter/splitter.spec.ts @@ -4031,6 +4031,443 @@ describe('Splitter', () => { }); }); + describe('Sizing', () => { + const orientations = ['horizontal', 'vertical'] as const; + // `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', + value: '1', + bar: 6, + handle: 4, + expander: 4, + radius: 2, + space: 5, + idle: 1, + indigoSpace: 3, + }, + { + size: 'medium', + value: '2', + bar: 12, + handle: 6, + expander: 5, + radius: 8, + space: 5, + idle: 4, + indigoSpace: 3, + }, + { + size: 'large', + value: '3', + bar: 18, + handle: 8, + expander: 6, + radius: 8, + space: 6, + idle: 8, + indigoSpace: 6, + }, + ]; + + 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, 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); + + 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`); + } + } + }); + + 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(); + // 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[near] - start[far], end[near] - handle[far]], + buttonsGap: end[near] - start[far], + inside: start[near] >= bar[near] && end[far] <= bar[far], + }; + } + + 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]); + } + }); + + 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 { + 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 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); + expect(handleTop()).to.equal(groupStart + 48); + + splitter.toggle('start'); + splitter.toggle('end'); + await elementUpdated(splitter); + 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 () => { + 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) { + const label = `${orientation} ${step.size}`; + splitter.style.setProperty('--ig-size', step.value); + await elementUpdated(splitter); + + const { handleLength } = measure(splitter); + const { handleGaps, inside } = gaps(splitter); + // 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]); + expect(inside, label).to.be.true; + } + } + }); + + 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'); + + for (const orientation of orientations) { + const length = orientation === 'horizontal' ? 'height' : 'width'; + splitter.orientation = orientation; + + splitter.style[length] = '500px'; + await elementUpdated(splitter); + // 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 24px boxes leave 20px of the bar. + splitter.style[length] = '68px'; + await elementUpdated(splitter); + + const { buttonsGap, inside } = gaps(splitter); + expect(buttonsGap, orientation).to.equal(20 + 12); + expect(inside, orientation).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('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 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, 4px and 8px idle bar by size, also 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( + step.idle, + 0.01 + ); + } + + splitter.orientation = 'vertical'; + await elementUpdated(splitter); + await nextFrame(); + finishAnimationsFor(splitter.shadowRoot!); + + expect(measure(splitter).bar, 'vertical').to.be.closeTo(8, 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( + 8, + 0.01 + ); + } finally { + configureTheme('bootstrap'); + } + }); + }); + + 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'); + 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(8, 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 { + 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/splitter.ts b/src/components/splitter/splitter.ts index a440e3b4e..2fd2273f7 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,18 +967,45 @@ 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._separator - ? roundPrecise(this._separator.getBoundingClientRect()[axis]) - : 0, - }; + this._measurement = { container, bar: this._measureBar(container) }; + } return this._measurement; } + /** + * 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 && layoutContainer)) { + return 0; + } + + 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 + asNumber(value), 0); + + return roundPrecise((thickness * container) / layoutContainer, 3); + } + /** The content box of the flex container - the basis for every percentage. */ private _getContainerSize(): number { return this._measure().container; diff --git a/src/components/splitter/themes/shared/splitter.common.scss b/src/components/splitter/themes/shared/splitter.common.scss index f9fa43caa..8ef06f129 100644 --- a/src/components/splitter/themes/shared/splitter.common.scss +++ b/src/components/splitter/themes/shared/splitter.common.scss @@ -4,9 +4,29 @@ $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-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'); + +: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)}))}; + + // 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'] { background: hsla(from $splitter-color h s l / 68%); @@ -68,11 +88,26 @@ $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 - #{$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: calc( + #{$expander-space} + clamp(0px, calc(#{100 * $bar-percent} - 2 * #{$expander-box}), #{rem(48px)}) + ); + } + } + :host([orientation='#{$orientation}']) { [part~='splitter-bar'] { #{$extent}: $bar-size; - padding-#{$main}: rem(1px); &:active { [part~='start-expand-btn'], @@ -88,23 +123,41 @@ $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; + 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/shared/splitter.indigo.scss b/src/components/splitter/themes/shared/splitter.indigo.scss index 3374d207e..2a7208c95 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 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(var(--_idle-size), var(--_bar-size))); %hide-controls { [part~='drag-handle'], @@ -31,6 +29,12 @@ $slim-splitter: calc( 1 / $splitter-size); } :host { + // 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; diff --git a/src/components/splitter/themes/splitter.base.scss b/src/components/splitter/themes/splitter.base.scss index 57959d27f..80dcd8f72 100644 --- a/src/components/splitter/themes/splitter.base.scss +++ b/src/components/splitter/themes/splitter.base.scss @@ -41,13 +41,26 @@ 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'] { + position: relative; cursor: pointer; width: 0; height: 0; + + &::before { + content: ''; + position: absolute; + + // Keeps the hitbox above the panes. + z-index: 1; + } } } } @@ -65,7 +78,6 @@ [part~='drag-handle'] { height: 25%; - margin: rem(48px) 0; } } @@ -82,7 +94,6 @@ [part~='drag-handle'] { width: 25%; - margin: 0 rem(48px); } } @@ -104,20 +115,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;