Skip to content

Use "substring match" rather than "starts with" selector to match responsive units. #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 30, 2013
Merged

Conversation

msweeney
Copy link
Contributor

Apologies for not catching this sooner, but the responsive units matching:

.pure-g-r > [class ^= "pure-u"] {
    width: 100%;
}  

fails when another class precedes the unit class.

This PR updates the selector to the following:

.pure-g-r > .pure-u,
.pure-g-r > [class *= "pure-u-"] {
    width: 100%;
}

I've added the trailing hyphen to avoid matching on pure-user or other potential classes that may start with pure-u.

One caveat is that this will also match classes that include the string pure-u-, for example impure-u-*.

@tilomitra
Copy link
Contributor

@msweeney Could you update the README.md to add this feature as a bullet under "NEXT"? I'll pull this in after that.

@ericf
Copy link
Collaborator

ericf commented May 30, 2013

Could you update the README.md to add this feature as a bullet under "NEXT"?

s/README/HISTORY/

tilomitra added a commit that referenced this pull request May 30, 2013
Use "substring match" rather than "starts with" selector to match responsive units.
@tilomitra tilomitra merged commit a194d15 into pure-css:master May 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants