Skip to content

Commit 9da2f8b

Browse files
chukaraveguergana
andauthored
Find a way around icon - text misalignment issue in codex buttons (#837)
* make text in all icon buttons its own span and style that * remove padding as it worsens the issue on chrome * Add explicit alignment to the icon as well Co-authored-by: Guergana Tzatchkova <guergana.tzatchkova@wikimedia.de> --------- Co-authored-by: Guergana Tzatchkova <guergana.tzatchkova@wikimedia.de>
1 parent e5d930e commit 9da2f8b

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

resources/js/Pages/Home.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@click="faqDialog = true"
1212
>
1313
<cdx-icon :icon="cdxIconInfo" />
14-
{{ $i18n('faq-button') }}
14+
<span class="text-with-icon-button">{{ $i18n('faq-button') }}</span>
1515
</cdx-button>
1616
</header>
1717
<cdx-dialog id="faq-dialog"
@@ -74,7 +74,7 @@
7474
:disabled="loading"
7575
>
7676
<cdx-icon :icon="cdxIconDie" />
77-
{{ $i18n('random-mismatches') }}
77+
<span class="text-with-icon-button">{{ $i18n('random-mismatches') }}</span>
7878
</cdx-button>
7979
</div>
8080
<form id="items-form" @submit.prevent="send">

resources/js/Pages/Layout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<LanguageSelectorButton :aria-label="$i18n('toggle-language-selector-button')"
1111
@click="onToggleLanguageSelector">
1212
<cdx-icon :icon="cdxIconLanguage" />
13-
{{ currentLanguageAutonym }}
13+
<span class="text-with-icon-button">{{ currentLanguageAutonym }}</span>
1414
</LanguageSelectorButton>
1515
<LanguageSelector v-show="showLanguageSelector" ref="languageSelector"
1616
@close="onCloseLanguageSelector" @select="onChangeLanguage">

resources/js/Pages/Results.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<inertia-head title="Mismatch Finder - Results" />
55
<cdx-button class="back-button" @click="() => $inertia.get('/', {})">
66
<cdx-icon :icon="cdxIconArrowPrevious" />
7-
{{ $i18n('results-back-button') }}
7+
<span class="text-with-icon-button">{{ $i18n('results-back-button') }}</span>
88
</cdx-button>
99
<section id="description-section">
1010
<header class="description-header">
@@ -16,7 +16,7 @@
1616
@click="instructionsDialog = true"
1717
>
1818
<cdx-icon :icon="cdxIconInfo" />
19-
{{$i18n('results-instructions-button')}}
19+
<span class="text-with-icon-button">{{$i18n('results-instructions-button')}}</span>
2020
</cdx-button>
2121
</header>
2222

resources/sass/app.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,14 @@ dl.import-meta .download-csv {
348348
// is marked as resolved.
349349
.cdx-button {
350350
@include ui-text-M($font-weight-bold);
351+
352+
.text-with-icon-button {
353+
vertical-align: text-top;
354+
padding-left: 5px;
355+
.cdx-icon {
356+
vertical-align: text-top;
357+
}
358+
}
351359
}
352360

353361
.svg {

0 commit comments

Comments
 (0)