Skip to content

Commit

Permalink
Find a way around icon - text misalignment issue in codex buttons (#837)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
chukarave and guergana authored Jan 22, 2024
1 parent e5d930e commit 9da2f8b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions resources/js/Pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@click="faqDialog = true"
>
<cdx-icon :icon="cdxIconInfo" />
{{ $i18n('faq-button') }}
<span class="text-with-icon-button">{{ $i18n('faq-button') }}</span>
</cdx-button>
</header>
<cdx-dialog id="faq-dialog"
Expand Down Expand Up @@ -74,7 +74,7 @@
:disabled="loading"
>
<cdx-icon :icon="cdxIconDie" />
{{ $i18n('random-mismatches') }}
<span class="text-with-icon-button">{{ $i18n('random-mismatches') }}</span>
</cdx-button>
</div>
<form id="items-form" @submit.prevent="send">
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<LanguageSelectorButton :aria-label="$i18n('toggle-language-selector-button')"
@click="onToggleLanguageSelector">
<cdx-icon :icon="cdxIconLanguage" />
{{ currentLanguageAutonym }}
<span class="text-with-icon-button">{{ currentLanguageAutonym }}</span>
</LanguageSelectorButton>
<LanguageSelector v-show="showLanguageSelector" ref="languageSelector"
@close="onCloseLanguageSelector" @select="onChangeLanguage">
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Pages/Results.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<inertia-head title="Mismatch Finder - Results" />
<cdx-button class="back-button" @click="() => $inertia.get('/', {})">
<cdx-icon :icon="cdxIconArrowPrevious" />
{{ $i18n('results-back-button') }}
<span class="text-with-icon-button">{{ $i18n('results-back-button') }}</span>
</cdx-button>
<section id="description-section">
<header class="description-header">
Expand All @@ -16,7 +16,7 @@
@click="instructionsDialog = true"
>
<cdx-icon :icon="cdxIconInfo" />
{{$i18n('results-instructions-button')}}
<span class="text-with-icon-button">{{$i18n('results-instructions-button')}}</span>
</cdx-button>
</header>

Expand Down
8 changes: 8 additions & 0 deletions resources/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,14 @@ dl.import-meta .download-csv {
// is marked as resolved.
.cdx-button {
@include ui-text-M($font-weight-bold);

.text-with-icon-button {
vertical-align: text-top;
padding-left: 5px;
.cdx-icon {
vertical-align: text-top;
}
}
}

.svg {
Expand Down

0 comments on commit 9da2f8b

Please sign in to comment.