Skip to content

Selector based filtering? #947

Closed
Closed
@merrywhether

Description

@merrywhether

The transform function currently allows you to make optimizations on specific properties, but it would also be really helpful to be able to drop rules based on selectors in situations where you can't easily shape parts of the css that you're including in your app like including libraries, common-style-repos, etc. I'm not sure if this could be fit into the current transform callback as a third argument.

An example of this would be having a lot of selectors like .theme-light .button and .theme-light .card, and it'd be great to be able to test selectors and drop all selectors that include .theme-light in some way, leading to possible selector-less rule blocks that could then be omitted entirely from the resulting output.

Activity

jakubpawlowicz

jakubpawlowicz commented on May 18, 2017

@jakubpawlowicz
Collaborator

Sure, we can have it. 👍

modified the milestones: 3.4.27, 4.2.0 on Jun 7, 2017
added a commit that references this issue on Jun 17, 2017

Fixes #947 - selector based filtering.

56d43e1
jakubpawlowicz

jakubpawlowicz commented on Jun 17, 2017

@jakubpawlowicz
Collaborator

Fixed in master & due in 4.2.0.

merrywhether

merrywhether commented on Jun 20, 2017

@merrywhether
Author

Awesome! Looking forward to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jakubpawlowicz@merrywhether

        Issue actions

          Selector based filtering? · Issue #947 · clean-css/clean-css