Skip to content

Fix vertical alignment of icons#440

Open
BenjaminSchaaf wants to merge 1 commit into
packagecontrol:gh-pagesfrom
sublimehq:icon-alignment
Open

Fix vertical alignment of icons#440
BenjaminSchaaf wants to merge 1 commit into
packagecontrol:gh-pagesfrom
sublimehq:icon-alignment

Conversation

@BenjaminSchaaf

Copy link
Copy Markdown
Contributor

Before:

Screenshot from 2026-06-24 18-05-59

After:

Screenshot from 2026-06-24 18-06-13

@kaste

kaste commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

This seems wrong as there is no vertical-align: center;

image

On my machine after looks like

image

@michaelblyons

Copy link
Copy Markdown
Contributor

Does it look okay if you change center to middle?

https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/vertical-align

@BenjaminSchaaf

Copy link
Copy Markdown
Contributor Author

Ah, vertical-align: center is a firefox-ism, and doesn't do the same as middle. Seems the modern approach is to use flexbox.

@BenjaminSchaaf

Copy link
Copy Markdown
Contributor Author

I've pushed a fix for this.

@braver

braver commented Jul 1, 2026

Copy link
Copy Markdown
Member

Icon sizing on the labels overview page needs a little help 😄

Scherm­afbeelding 2026-07-01 om 12 37 59

This might be the patch:

diff --git a/labels.njk b/labels.njk
index e95408b9..1f73a3c0 100644
--- a/labels.njk
+++ b/labels.njk
@@ -55,7 +55,7 @@ page_type: labels
           {% set icon_id = item.key | label_icon_id %}
           {% if icon_id %}
             {% set tint = item.key | label_icon_tint %}
-            <svg class="{{ (' label-icon--' ~ tint) if tint }}" aria-hidden="true">
+            <svg class="inline-icon {{ (' label-icon--' ~ tint) if tint }}" aria-hidden="true">
               <use href="/{{ 'static/label-icons.svg' | bust }}#{{ icon_id }}"></use>
             </svg>
           {% endif %}

In general icons in labels are now smaller than before (they were 16x16 pixels, which is preferable as that's typically the size they're designed for, meaning you get partial-pixel line widths etc):

before
Scherm­afbeelding 2026-07-01 om 12 38 59

after
Scherm­afbeelding 2026-07-01 om 12 39 03

    vertical-align: -0.125em;

This doesn't seem to actually do anything on my machine (Chromium). I don't think it should either, the inline-icons are in a .button, which is a flex box.

The PR does improve the alignment of the "stats" icons though, it just seems to have a bit of fallout elsewhere.

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.

4 participants