WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 4 years ago

#30713 closed enhancement (maybelater)

Customizer control subclasses (custom controls) should have all parent control types as html classes

Reported by: celloexpressions Owned by:
Milestone: Priority: low
Severity: normal Version: 4.1
Component: Customize Keywords: needs-patch
Focuses: Cc:

Description

See https://wordpress.slack.com/archives/core/p1418599325001596. This will let us simplify our css selectors, and make it easier to create custom controls without duplicating core css. Particularly notable with the core media controls, which are nested several levels deep ((potentially-in-the-future media) -> upload -> image -> background-image/header-image).

Attachments (1)

30713.diff (4.5 KB) - added by celloexpressions 6 years ago.
Render html classes for the entire sub-class tree's types, clean up core CSS selectors accordingly for media controls.

Download all attachments as: .zip

Change History (12)

@celloexpressions
6 years ago

Render html classes for the entire sub-class tree's types, clean up core CSS selectors accordingly for media controls.

#1 @celloexpressions
6 years ago

  • Keywords has-patch needs-testing added; needs-patch removed
  • Milestone changed from Future Release to 4.2

Whichever is committed second between this and #29215 will need to be updated to making the only remaining CSS class for the media controls .customize-control-media. This shouldn't have any back-compat issues since we're adding new classes and keeping the existing ones in place as well, unless anyone was relying on the previous way parent class types were scoped in.

#2 @ocean90
6 years ago

IMO the order of the class names should be inverted. Instead of

customize-control customize-control-header customize-control-image customize-control-upload

it should be

customize-control customize-control-upload customize-control-image customize-control-header

Version 0, edited 6 years ago by ocean90 (next)

#3 @ocean90
6 years ago

  • Keywords needs-patch added; has-patch needs-testing removed

#4 @DrewAPicture
6 years ago

@celloexpressions, @westonruter: Can we can get an update and some movement here?

#5 @celloexpressions
6 years ago

I couldn't figure out any other way of doing this, and there wouldn't be an easy way to reverse the order with this approach. So we either need to just go with it, or punt and try to come up with a new approach.

#6 @DrewAPicture
6 years ago

  • Keywords needs-refresh added

Patch needs to be refreshed, and feedback from @ocean90 addressed. We're going need a new patch pretty soon or punt to a future release and take another shot at it.

#7 @ocean90
6 years ago

  • Keywords needs-refresh removed
  • Priority changed from normal to low

This ticket was mentioned in Slack in #core by drew. View the logs.


6 years ago

#9 @ocean90
6 years ago

  • Milestone changed from 4.2 to Future Release
  • Type changed from defect (bug) to enhancement

Still no new patch, punting.

This ticket was mentioned in Slack in #core by celloexpressions. View the logs.


5 years ago

#11 @celloexpressions
4 years ago

  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from new to closed

Related: #30618 now has an approach that allows the mess of media control selectors to be removed. While I still like the idea of including parent classes as html classes for a variety of reasons, the only technical implementation that I could find was the patch above which, as noted above, is concerning.

I'm going to close this as maybelater for now and we can revisit if a better solution emerges. In the meantime, workarounds like the one on #30618 are possible, if inconvenient.

Note: See TracTickets for help on using tickets.