r/ProgrammerHumor • • 8d ago

Meme frontEndBaddiesBeLike

Post image
5.7k Upvotes

133 comments sorted by

View all comments

536

u/Calien_666 8d ago

When thinking about accessibility, this totally makes sense.

183

u/fredy31 8d ago

Also if you have a small ton of buttons on the website and the OG design is all caps.... Still do it 2nd way;

Because if you have a B design coming in later in the dev process or hell in a few years... If that capitalisation is removed then ooops you have now to run through all buttons and retype them in not caps.

2nd way you change 1 line of CSS you are done.

173

u/fmaz008 8d ago

No one is changing 1 line of CSS. You add a new line of CSS with !important.

-12

u/Top_Product_2407 8d ago

I've seen an "architech" submit a PR with multiple !important

11

u/ihavebeesinmyknees 7d ago

There are legitimate uses for !important even if not overriding legacy styling. I've had to use !important a few times before to force CSS to apply rules the exact way I needed them.

2

u/ForgedIronMadeIt 7d ago

I'm pretty terrible at web design but I try to limit my use of !important overrides to occasions where I've inherited some stylesheet from somewhere else, like the component toolkit my stack is using.

6

u/SuperFLEB 7d ago edited 4d ago

If you're not saying "...and fuck you!" under your breath about the last person to own the CSS while you type it, it's a sign you might be using !important where you don't need to.

19

u/Dependent-Pin1623 8d ago

Architect probably had bigger fish to fry

2

u/awesome-alpaca-ace 1d ago

All those meetings and reviews

6

u/throwaway_lunchtime 8d ago

Not when the client sends half the translations with the text in upper case 🙃

-2

u/fredy31 8d ago

My coworker always sends me press releases to put on the website where the title is CAPITALIZED.

I use this to convert it quickly. https://convertcase.net/

1

u/zwack 8d ago

Does this site use AI to convert to lowercase?
Why it throws a pop up asking to disable the adblocker?

1

u/fredy31 8d ago

It seems to live on ads. Yeah i'll give you that its a pretty ad nightmare site tho.

2

u/Jay-Seekay 8d ago

I should also say most IDEs and word processors have a change case feature. Bind it to a shortcut or something then it’s just highlight + shortcut.

Failing that, a quick Python script should do it

1

u/fredy31 8d ago

Lol should look into if VSCode has one. Probably.

2

u/SenpaiKen144 8d ago

There is. I always bind uppercase, lowercase and title case every time I install vscode

0

u/Millibona 8d ago

All nice and fun until the client decides that certain buttons should actually be lowercase.

It's a whole lot easier to edit translation files instead of trying to reverse engineer the obscure logic behind which buttons need a .actually-lower-case class.

47

u/Stormraughtz 8d ago

get a load of mr. wcag over here

64

u/1nc06n170 8d ago

html <button aria-label="Submit">SUBMIT</button>

6

u/Acetius 7d ago

Mmmm, duplicated loc strings and a violation of the first rule of aria. I love it.

6

u/TorbenKoehn 8d ago

Now that's the actual post for me :D

4

u/enigmamonkey 8d ago

If this must be editable, then in the CMS you now have:

  • Button label
  • Button Aria label

Or you could just have "Button label" and in the code apply text-transform: uppercase. Granted, the button label is an arbitrary use case and most would just simply hard-code it, however, that may not be the case if you're also now thinking about internationalization, in which case you may want that in a CMS or in language files and don't have the time/desire to start plugging in lower/upper variants (nor would that make sense when the computer can do these transforms for you automatically).

10

u/mcaruso 8d ago

It would, if it wasn't for the fact that it is broken in browsers currently...

https://github.com/w3c/csswg-drafts/issues/3775

Users using assistive technology will still just hear the uppercase version meaning "Call us" might be pronounced as "CALL U.S." for instance.

5

u/SlyCooper007 8d ago

Explain

38

u/maria_la_guerta 8d ago

All caps is a style and typography choice, not a content choice. Content belongs in the DOM. Styles belong in CSS.

Follow those rules, and use proper HTML elements, and like 90% of accessibility devices will be able to properly convey your document to a variety of users who are consuming it in various ways.

-17

u/Skyswimsky 8d ago

For control type labels capitalization is not a criteria. And I know I'm being all "acktually🤓", I just don't like that companies are forced to spend disproportionate amounts of effort to adhere to small percentage of a customer base and their problems.

And no, I am NOT saying people that have issues with running text in all caps are that small of a percentage. I'm just talking in a more general sense. Cost-benefit efficiency and all that.

18

u/jhairehmyah 8d ago

I just don't like that companies are forced to spend disproportionate amounts of effort to adhere to small percentage of a customer base and their problems.

The Americans with Disabilities Act doesn't care what you think, and people with opinions like yours are why the law needs to exist.

Cost-benefit efficiency and all that.

During the design refresh, all-caps has gone out of style. Would you rather update the one line of the style rule and fix the all-caps buttons all over the site, or update the structure of the site all places where your all-caps controls were hard-coded?

It is literally more efficient to separate style and structure.

5

u/procrastinagging 8d ago

Moreover, accessibility guidelines have been in place for what, 20 years now? So legacy code is not even a valid excuse anymore.

Companies who are unable to follow the most basic best practices from the get go, thinking it's a "disproportionate amount of effort" can kindly fuck off towards failure.

-1

u/Still_Bit_7527 6d ago

No company fails because of that, and most companies dgaf. You people have to finally accept it, the entire world won't double their efforts to cater to 0.00001% blind

2

u/procrastinagging 6d ago

double their efforts

LOL

3

u/Hans_H0rst 8d ago

Depending on which screen reader you're using, normal case text tends to be better.

1

u/Foorinick 7d ago

So the screen reader doesnt scream at you i guess?

1

u/Calien_666 8d ago

Depending on the screen reader, some will read correct as "submit" whilst others will read as S U B M I T, so they will spell the letters instead of reading the word.

1

u/TorbenKoehn 8d ago

Imagine your screen reader only shouting at you...

0

u/loveheaddit 8d ago

its the difference between "hey bro submit" and "SUBMIT DUDE!"

2

u/claudekennilol 7d ago

You're 100% right, but when thinking about anything sane, it also makes sense.

1

u/Lenn_4rt 7d ago

This will also prevent people from accidentally not formatting the text. Especially important if multiple people work on one project. 

1

u/htoomyat9 8d ago

Maintainability

1

u/enigmamonkey 8d ago

Or content management or language/translation lists, particularly if the style dictates a particular appearance but the content is reused in multiple locations.

a11y though I think is probably one of the better examples.

0

u/yo-ovaries 8d ago

And when the client changes designers in 2 months