Dokuwiki: Please add classes to elements with IDs

Created on 24 Nov 2017  路  11Comments  路  Source: splitbrain/dokuwiki

As designer/front end developer I won't style any ID, because that's not how we do frontend in 2017.

https://github.com/splitbrain/dokuwiki/blob/0f8cc87bd3c00da5e455ea3abf06e9893c9b9d70/inc/html.php#L2102
Please replace <div id="dw__toc"> with <div id="dw__toc" class="dw__toc">

Or provide ways to hook the output or at least to add classes.

CSS XHTML JS Browsers good first issue

Most helpful comment

@bitstarr It makes perfect sense to just use ID there. TOC is unique element.

I would argue that it is against "how we do frontend in 2017" to just duplicate ID name into class because it just spams html. Seems a bit demagoguery.

Is specificity a problem or what?

All 11 comments

Good idea. A pull request is welcome of course :)

You are right, but at the moment I'm trying to build a template and I have no experience with the code of dokuwiki. I simply saw the shortcomings for providing quality styling.

I hope someone who is more involved will help out.

If you spot more, please add them here :)

@bitstarr It makes perfect sense to just use ID there. TOC is unique element.

I would argue that it is against "how we do frontend in 2017" to just duplicate ID name into class because it just spams html. Seems a bit demagoguery.

Is specificity a problem or what?

Yes, specifity is still a big deal for writing sane and reusable CSS. Also the spearation of concerns is a best practice.

@bitstarr It's your itch, please either scratch it by providing a PR or enjoy it in silence.

Will this work @bitstarr?

Sorry about the first PR, I totally forgot to add a fix branch to my fork.

This looks nice. Thanks for the effort @DeathCamel57!

Anytime @bitstarr!

Implemented by #2178

Was this page helpful?
0 / 5 - 0 ratings