Page MenuHomePhabricator

css-only codex message component uses a smol icon by default
Closed, DuplicatePublic

Assigned To
None
Authored By
ekrem
Jul 3 2025, 12:53 PM
Referenced Files
F62822153: image.png
Jul 3 2025, 3:22 PM
F62822151: image.png
Jul 3 2025, 3:22 PM
F62821893: Screenshot 2025-07-03 at 5.10.43 PM.png
Jul 3 2025, 1:11 PM
F62821878: Screenshot 2025-07-03 at 5.07.46 PM.png
Jul 3 2025, 1:11 PM
F62821855: Screenshot 2025-07-03 at 4.52.16 PM.png
Jul 3 2025, 12:53 PM
F62821848: image.png
Jul 3 2025, 12:53 PM
F62821836: image.png
Jul 3 2025, 12:53 PM
F62821833: image.png
Jul 3 2025, 12:53 PM

Description

background

recently, i revised MediaWiki:Editpage-head-copy-warn (basically an editnotice that warns the editors that copyrighted material shouldn't be added to wikimedia sites) on azwiki to make it codex-based (see fig. 1 vs. fig. 2)

but as you can see in the photo, the ℹ icon in the new version has almost half the width it should have. that's because the text is too long and the <div> that contains the overflowing text kind of "squeezes" the icon. this issue doesn't happen if we use the vue-based component (see fig. 3) as the class cdx-icon--medium appended to the icon's container will set a min-width: 18px;. the css-only version, however, is going to have a styling that goes like this: .cdx-message .cdx-message__icon { min-width: 10px; } and it causes this annoying situation.

what to do to reproduce

insert a css-only message component anywhere that has a long ass text; take this code as an example:

<div class="cdx-message cdx-message--block cdx-message--notice" aria-live="polite"><!--

--><span class="cdx-message__icon"></span><!--
--><div class="cdx-message__content">Müəlliflik hüquqları ilə qorunan material əlavə edilməməlidir. Məzmun [[Vikipediya:Ensiklopedik əhəmiyyətlilik|ensiklopedik olmalıdır]] və [[Vikipediya:Etibarlı mənbələr|etibarlı mənbələrlə]] [[Vikipediya:Yoxlanıla bilmə|təsdiqlənə bilməlidir]]. Vikipediyadakı materiallar lisenziyanın şərtlərinə uyğun olduqda hər kəs tərəfindən redaktə edilə, istifadə oluna və paylaşıla bilər.</div><!--

--></div>

what could be done

the aforementioned 10px could be replaced with an 18px, which perfectly solves the issue (see fig. 4)

referenced figures

Screenshot 2025-07-03 at 5.07.46 PM.png (242×1 px, 715 KB)
Screenshot 2025-07-03 at 5.10.43 PM.png (210×1 px, 256 KB)
image.png (172×1 px, 54 KB)
Screenshot 2025-07-03 at 4.52.16 PM.png (1×2 px, 2 MB)
figure 1figure 2figure 3figure 4