No Code Attached Yet
avatar sakiss
sakiss
21 May 2024

Steps to reproduce the issue

Visit your Joomla admin site and Inject the following html in the <div id="system-message-container">

<joomla-alert type="warning" close-text="Close" dismiss="true" style="animation-name: joomla-alert-fade-in;" role="alert">
<button type="button" class="joomla-alert--close" aria-label="Close"><span aria-hidden="true">×</span></button>
<div class="alert-heading">
<span class="warning"></span>
<span class="visually-hidden">Warning</span>
</div>
<div class="alert-wrapper">
<div class="alert-message"><div class="d-flex">
<a class="btn btn-primary ms-4" href="#someModal" data-bs-toggle="modal">Some Action</a>
</div>
</div>
</div>
</joomla-alert>

Expected result

The button's text to be easily readable.

Actual result

The button's text can hardly be read.
alert_css

System information (as much as possible)

J5.1.0

Additional comments

Seems to be caused by that css:

#system-message-container joomla-alert[type="warning"] a {
  color: var(--state-warning-text);
  text-decoration: underline;
}

Found in the: media/templates/administrator/atum/css/vendor/joomla-custom-elements/joomla-alert.min.css

avatar sakiss sakiss - open - 21 May 2024
avatar joomla-cms-bot joomla-cms-bot - change - 21 May 2024
Title
Css a.btn in <joomla-alert> web component
Css a.btn in web component
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 May 2024
avatar sakiss sakiss - change - 21 May 2024
The description was changed
avatar sakiss sakiss - edited - 21 May 2024
avatar dgrammatiko
dgrammatiko - comment - 21 May 2024

Try:

    <joomla-alert type="warning" close-text="Close" dismiss="true" style="animation-name: joomla-alert-fade-in;" role="alert">
        <button type="button" class="joomla-alert--close" aria-label="Close"><span aria-hidden="true">×</span></button>
        <div class="alert-heading">
            <span class="warning"></span>
            <span class="visually-hidden">Warning</span>
        </div>
        <div class="alert-wrapper">
            <div class="alert-message">
                <div class="d-flex">
                    <p>whatever</p>
                    <button type="button" class="btn btn-primary ms-4" data-bs-toggle="modal" data-bs-target="#exampleModal">Some Action</button>
                </div>
            </div>
        </div>
    </joomla-alert>

output:
Screenshot 2024-05-21 at 9 30 14 PM

FWIW <a> should not be used for actions, the semantically correct tag is <button>

avatar Pinkeltje
Pinkeltje - comment - 22 May 2024

It happens to have as link i.e. when linking to a developers website to get paid version.
2024-05-22 Screenshot 382
Quick fix is adding this to css:
.alert.alert-warning btn a { color: #fff; }
2024-05-22 Screenshot 383

avatar sakiss
sakiss - comment - 22 May 2024

Thank you!.
Though, the issue is opened for a fix in the 1st place.

avatar Pinkeltje
Pinkeltje - comment - 23 May 2024

Same with alert info.
2024-05-23 Screenshot 384
And this one:
2024-05-26 Screenshot 392

avatar rdeutz rdeutz - change - 1 Jun 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-06-01 12:53:08
Closed_By rdeutz
avatar rdeutz rdeutz - close - 1 Jun 2024
avatar rdeutz
rdeutz - comment - 1 Jun 2024

@sakiss the fix is use a button. The other mentioned places are from 3rd part extensions and out of the scope of the core.

Add a Comment

Login with GitHub to post a comment