Add control scaling support with --k-scale token#109
Draft
Conversation
Introduce a unitless --k-scale CSS custom property that controls the
dimensions of interactive controls independently of font-size. Define
derived size tokens (--k-size-sm/md/lg) that bake in the multiplier,
so components reference semantic tokens instead of hardcoded rem values.
Scoping --k-scale to a container (e.g. .compact-sidebar { --k-scale: 0.85 })
scales only descendant controls without affecting text or the rest of the page.
https://claude.ai/code/session_01UeEamizUgKrTfKTi44grHr
✅ Deploy Preview for kinu-sh ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
Size Change: +268 B (+0.88%) Total Size: 30.7 kB 📦 View Changed
ℹ️ View Unchanged
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a new
--k-scaleCSS custom property that allows independent scaling of interactive control dimensions (buttons, inputs, checkboxes, switches, etc.) without affecting text size. This enables compact or spacious UI variants through a single multiplier token.Key Changes
New CSS variables in
src/variables.css:--k-scale: Unitless multiplier (default: 1) for control dimensions--k-size-sm,--k-size-md,--k-size-lg: Derived size tokens that incorporate the scale factorUpdated component styles to use scale-aware sizing:
button/style.css): Heights now reference--k-size-sm/md/lgtokensinput/style.css): Heights use derived size tokensswitch/style.css): All dimensions scaled withcalc()expressionscheckbox/style.css): Width/height scaled independentlyradio-group/style.css): Dimensions scaled with multiplierDocumentation (
docs/pages/theming.md): Added comprehensive guide explaining:--k-scaleworks as a unitless multiplierfont-sizeTheme customizer (
demo/src/theme-customizer.tsx): Integrated--k-scaleoutput when scale differs from 1Implementation Details
calc()expressionshttps://claude.ai/code/session_01UeEamizUgKrTfKTi44grHr