librewiki / liberty-skin

Liberty skin
GNU General Public License v3.0
17 stars 49 forks source link

Coding style tweaks #8

Closed mary-kate closed 1 year ago

mary-kate commented 1 year ago

Mostly just stylistic prettification to have the codebase conform to MediaWiki's code style since some of my earlier changes were undone in e.g. daa29db9927ee93411f2c73435219e3832a0dfc7 and earlier commits.

In LibertyHooks.php I fixed a typo and changed a variable name at the same time to a lowerCamelCase one as per MediaWiki's coding conventions. (The original variable name had a superfluous "e" in it.)

In some of the CSS files, I compacted longer multi-line statements like


.Liberty
    .content-wrapper
    .liberty-content
    .liberty-content-main
    .catlinks
    ul
    > li {

to a single-line statement like .Liberty .content-wrapper .liberty-content .liberty-content-main .catlinks ul > li { because:

  1. overall consistency with existing CSS (here and elsewhere)
  2. overall consistency with MediaWiki's coding style
  3. it just looked better to me

That said, it may be desireable to convert some/most/all of these CSS files into LESS in the future, as it allows more "programmatical" writing of CSS rules without having to duplicate significant portions of a selector and it allows more sensible indentation of rules that's not possible in CSS. (Personally, though, I prefer CSS as-is, even if the cost of that is having somewhat long-ish lines or even having to break the lines at some point.)

In share-button.js I also added a few missing semi-colons.

P.S. Great to see Librewiki on GitHub! (I do wish GitHub wouldn't be such a pain about authentication, but...you win some, you lose some, I guess.)

cc @Revi for review

revi commented 1 year ago

Someone else from the org will deal with CI (GitLab CI to GitHub Actions) and review the patch.

Also: I've added you (back) to the repo as you had it @ GitLab. To make TWN without much hassle I'm not enforcing pull request requirement but please take it as a soft requirement.

zlzleking commented 1 year ago

Thanks for your contributions!