Skip to content

Fix icon sizing#358

Draft
vekkele wants to merge 3 commits intonextfrom
feat/icon-sizes
Draft

Fix icon sizing#358
vekkele wants to merge 3 commits intonextfrom
feat/icon-sizes

Conversation

@vekkele
Copy link
Contributor

@vekkele vekkele commented Jan 16, 2026

Summary

This change is originally requested by Anastasia

The problem: we use svg scaling (setting its width and height) for different sizes of the same icon. It leads to incorrect stroke scaling, blurry icons sometimes and overall visually different resulting icon because Anastasia prepares different icon variants for different cases.

To fix it I propose the following changes:

  1. Import icons from figma with square viewbox and not only "stroke" part as we do now.
  2. Name icon variant depending on viewbox size with default viewbox - 16px. For example, icon info with viewbox 16x16 would be named info.svg, and with viewbox 12x12 - info-12.svg
  3. Use correct icon variants in different cases

Code changes from this PR:

  1. No default w (width) prop for Svg component. If width is not provided it is infered from name (use number postfix (e.g. info-12.svg -> 12px) or 16px by default
  2. Button now tries to find small (12px) icon if its size is not md or lg instead of setting its size to 12px
  • To make it possible I added checkSvgIdAvailable helper function which check if there is icon with provided id. List of available icons is being filled build time
  1. Add search icon variants, sidebar icon is updated. Use correct search icon variant in components

Warning

There can be unexpected icon changes present after merging this PR so some updates are needed in client projects (e.g. Sanbase): like icons updates and iconSize and w fixes

Notion card

https://www.notion.so/santiment/Fix-night-mode-bugs-2d12a82d1361804e8fa6c61d0dc685d6?source=copy_link

@vekkele vekkele changed the title WIP Fix icon sizing Jan 19, 2026
@vekkele vekkele self-assigned this Jan 19, 2026
@vekkele vekkele marked this pull request as ready for review January 19, 2026 08:27
@vekkele vekkele marked this pull request as draft January 20, 2026 06:52
@vekkele
Copy link
Contributor Author

vekkele commented Jan 20, 2026

Current approach seem to not work with design usage. Switching to draft to think out another way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant