Skip to content
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

Change propWhiteList to propList #29

Merged
merged 3 commits into from
Jan 15, 2017
Merged

Change propWhiteList to propList #29

merged 3 commits into from
Jan 15, 2017

Conversation

cuth
Copy link
Owner

@cuth cuth commented Jul 18, 2016

This is a PR to change propWhiteList to propList.

This would solve issue #1 by allowing strings to match the beginning, end or anywhere in the prop.

{
  propList: ['^margin', '~border', '$-top']
}

This would solve issue #25 by allowing wildcard and "not" selectors.

{
  propList: ['*', '!~border']
}

New option description:
propList (Array) The properties that can change from px to rem.

    • Set this to an empty array to disable the white list and enable all properties.
  • Values need to be exact matches. - Values need to be exact matches.
    • Use wildcard * to enable all properties. Example: ['*']
    • Use ~ to match any part of the property. (['~position'] will match background-position-y)
    • Use ^ to match the start of the property. (['^font'] will match font-weight)
    • Use $ to match the end of the property. (['$-radius'] will match border-top-right-radius)
    • Use ! to not match a property. Example: ['*', '!letter-spacing']
    • Combine the "not" prefix with the other prefixes. Example: ['*', '!~margin']

propWhiteList will map to propList for legacy support.

@cuth cuth mentioned this pull request Jul 18, 2016
@sndrs
Copy link

sndrs commented Jul 18, 2016

what do you think about using * more generally, instead of ~, ^ and $? so that:

['*position*'] => ['~position']
['font*'] => ['^font']
['*-radius'] => ['$-radius']

@cuth
Copy link
Owner Author

cuth commented Jul 18, 2016

@sndrs, I think you are right. That is easier to understand.

@awcross
Copy link

awcross commented Aug 6, 2016

+1

@cuth cuth mentioned this pull request Dec 21, 2016
@jieyou
Copy link

jieyou commented Jan 4, 2017

@cuth , Thanks for your wonderful plugin.
As talked above, when can you modify the signs to @sndrs 's suggestion and merge the PR to master?
It's very useful to my project that I want almost every length props can be auto translate to REM
Thanks again!

@cuth cuth merged commit 22898e3 into master Jan 15, 2017
@cuth cuth deleted the feature/prop-list branch January 15, 2017 22:22
@sndrs
Copy link

sndrs commented Jan 16, 2017

❤️ 😃

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.

4 participants