Page MenuHomePhabricator

Remove all id CSS selectors in MobileFrontend
Closed, DeclinedPublic

Description

There is no good reason for using id's in MobileFrontend. They cause headaches when trying to implement new features due to competing CSS rules and they point to an architecture that needs more thought. For example the #section_0 heading.

We should aim to remove any id selectors, leaving only those that are needed to override local templates or styles in MediaWiki core.

The use of IDs has caused pain in the implementation of T139794

Event Timeline

Don't we want to use IDs to denote uniqueness of some elements?

Also we need to keep IDs of sections as we want to link to them. There are possibly other valid cases for not removing IDs. We should investigate more.

Sure. We can keep IDs. IDs are good.
The thing that is not so good imo is using them for styling:
https://github.com/CSSLint/csslint/wiki/disallow-ids-in-selectors

jhobs triaged this task as Medium priority.Jul 21 2016, 8:26 PM
jhobs awarded a token.
jhobs moved this task from Incoming to Triaged but Future on the Web-Team-Backlog board.

@Jdlrobson, can this task be done in Google-Code-In-2016? If yes then I will wish that you make a list of IDs that should be removed and how this can be done in order not to cause any regressions. Else we can just leave this a regular task for some interested person to work on. What do you think?

@D3r1ck01 probably not. It's going to require someone who is very familiar with the MobileFrontend extension and its architecture.

@D3r1ck01 probably not. It's going to require someone who is very familiar with the MobileFrontend extension and its architecture.

Ok I see. That sounds ok then. Thanks for the response.

This comment was removed by Jdlrobson.

We are using IDs less in MobileFrontend. I believe most of them should be resolved by T281930 and I don't think it's helpful having this ticket from 2016 still open.
The eslint rule selector-max-id is being applied to all repositories and repositories should fix those issues at their leisure.