Make WordPress Core

Opened 4 years ago

#40686 new enhancement

CSS: introduce naming and usage conventions for JS targeting

Reported by: afercia Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: ui Cc:


As part of the broader goal of the CSS roadmap, it would be great to start introducing CSS classes naming and usage conventions for JS targeting.

This need clearly emerged during the ongoing exploration to revamp the Settings API, and woud benefit all the codebase. Work on the Settings API is happening on GitHub and there's an open issue for this.

Quoting from the doc @helen prepared to share some thoughts (the doc is available on the GitHub issue):

Reusing styling class names is fragile and obscures intent when doing long-term maintenance.

Personally, I can only add that I can't count the number of times when touching some CSS class or ID forced me to check all the codebase to make sure they weren't used also for JavaScript related purposes :)

Change History (0)

Note: See TracTickets for help on using tickets.