News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Why use "style" in the php ?

Started by Zatalyz, September 21, 2020, 03:59:25 AM

Previous topic - Next topic

Zatalyz

I try to customize a theme, and I see a strange thing. In the php files, there are a lot of "style", like this :
<input type="submit" style="margin-top: 1em;" value="', $txt['login'], '" class="button_submit">'

I also find this kind of thing in the default theme. I was learn that this was a bad practice, that everything about style should be declared in the css, with "class". But there are so many of them, everywhere, that I come to doubt: is there a reason for using this, instead of class?

Antechinus

Yes. The reason is laziness. :D Someone either didn't find it, or just hit it with something large and heavy during testing and forgot about it afterwards. Feel free to get rid of it and use your own CSS if you prefer.

mark@123

Yes, This bad practice and get rid off and made your own css file and  kept all css in seperate css folder.

Zatalyz

Thanks :) So, no regret !
I clean this code massively  ;D

Antechinus

There is plenty to keep you busy. :D I've had a go at it a few times. The best thing about default 20.x code is how much you can throw out and still have it work,

Advertisement: