Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Color for Error Messages

by LanX (Saint)
on Mar 18, 2022 at 13:24 UTC ( [id://11142218]=monkdiscuss: print w/replies, xml ) Need Help??

Today we had again a case of a monk complaining that he couldn't post.

Turned out that he used only one word in the title and overlooked the black and bold error-message in between other bold labels. (Which I can understand)

<strong>Title must be more than one word!</strong>

One possible solution for you all is to adjust Display Settings with

strong { background-color: white; color: red; }

This should stand out with all color themes and there are only 14 nodes using <strong> tags, most of which are pretty obscure.

Of course it might be better to add an error_msg class to the CSS, but I learned to humbly make small steps. :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re: Color for Error Messages
by choroba (Cardinal) on Mar 18, 2022 at 14:03 UTC
    > Of course it might be better to add an error_msg class to the CSS, but I learned to humbly make small steps. :)

    I submitted patches to both places where the message is created.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      Thanks! Please change strong to span, and error_msg to warning. tia.

        I'm not sure it's a warning. It blocks publishing the node, it's an error.

        map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re: Color for Error Messages
by jdporter (Paladin) on Mar 18, 2022 at 14:03 UTC
    add an error_msg class to the CSS

    search for class="warning" in code

    Unfortunately, it appears that there is no standard CSS to set the appearance of such content. So someone should submit a patch to Common Theme CSS to do that.

    Thanks!

    I reckon we are the only monastery ever to have a dungeon staffed with 16,000 zombies.

        If you really want people to pay attention, try this in your display settings:

        .warning:before { content: url('https://cavac.at/pics/hackman2.gif'); } strong:before { content: url('https://cavac.at/pics/hackman2.gif'); }

        SCNR

        perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
        Some changes have been applied now - thank gods ;)

        We have now identical classes .error and .warning with white font on red background.

        When interested try to reply here, while leaving exactly one word in the title.

        Preview should show this warning then:

        • What you get

          Title must be more than one word!

          (span with new class)

        • What to expect (almost):

          Title must be more than one word!

          (simulation without CSS but table and font)

        NB: do a hard reload like Shift-Ctrl-R ° to ensure the old CSS isn't taken from the cache.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

        update

        this might collide with the color-theme you've configured in your settings.

        °) or

        • Ctrl-F5 Firefox
        • Shift-F5 Chrome
        • For completeness: there are more tricks with Key-modifiers and clicking Reload-symbol or typing Return inside the adressbar
Re: Color for Error Messages
by etj (Deacon) on Mar 23, 2022 at 13:41 UTC
    Speaking of single-word node titles, I note that PDL is currently a relatively random note from 2001 recommending PDL be used for a particular thing.

    Is there any scope for that node to be renamed, and for the current PDL maintainer (which would be me at this moment) to have that node as a sort of mini-forum node where I would "comment"/reply to for release announcements, and people could comment/reply on with questions, etc? This is partly motivated by Google Chrome now having a "search PerlMonks" feature which does a naive nodename search, which if one enters "PDL" one gets that random-ish node, which isn't super helpful.

      I have created a new root node for you: PDL

      Please populate it as you see fit.

      FYI, I renamed the old one out of the way.

      Thanks!

        I only wish this site had the capability for me to upvote this dozens of times. Thank you!
      There is no technical reason to rename it. Replies would go thru, because of the Re: parts.

      I can't comment on the rest, sorry.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://11142218]
Approved by Athanasius
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-16 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found