• Welcome to Simple Machines Community Forum. Please login or sign up.

Deprecated CSS class - lpr_border

Started by Antechinus, August 28, 2021, 10:40:54 PM

Previous topic - Next topic

Antechinus

August 28, 2021, 10:40:54 PM Last Edit: September 15, 2021, 01:08:27 PM by Diego Andrés
I remember this one.

There was a pull request put in some time ago, that apparently deleted this from the CSS, and substituted a simple border added to .lastpost in responsive.css. The reason being that a purely presentational class, that only appeared in one place anyway, and might annoy anyone who didn't want a border there anyway, was not worth having in the markup.

Which is all groovy, but someone forgot to actually remove said class from the markup. :P

Code (BoardIndex.template.php - Find) Select
// Show the last post if there is one.
echo'
<div class="lastpost lpr_border">

Code (BoardIndex.template.php - Replace) Select
// Show the last post if there is one.
echo'
<div class="lastpost">

Code (MessageIndex.template.php - Find) Select
// Show the last post if there is one.
echo '
<div class="lastpost lpr_border">

Code (MessageIndex.template.php - Replace) Select
// Show the last post if there is one.
echo '
<div class="lastpost">

Hey presto, groovy new markup now matches existing CSS. You know you want it. :)

Antechinus

Just found the relevant commit for this one: github.com/SimpleMachines/SMF2.1/pull/6502.
And yes, it gets rid of the deprecated class from the CSS, but leaves it in the markup. Seems odd.

Also, that commit ties in with this: Redirect boards on mobile - div.lastpost better hidden. The code that was removed from the markup in pull/502 was obviously intended to drop empty .lastpost divs on mobile, with redirect boards being the obvious target case on a mature forum. But, IMO it's still better handled by appending the board type as an extra class for the .up_contain div.

(Incidentally, whoever thought it was a good idea to call the board row wrapper divs "up_contain"? It would be hard to invent a less clearly descriptive class name for them. Using "board_row" for the class name would have been infinitely more sensible, and could still easily be done before Final.)

Advertisement: