Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: evrone/postcss-px-to-viewport
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0
Choose a base ref
...
head repository: evrone/postcss-px-to-viewport
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 5,986 additions and 285 deletions.
  1. +2 −1 .gitignore
  2. +1 −0 .npmignore
  3. +51 −0 CHANGELOG.md
  4. +74 −0 CODE-OF-CONDUCT.md
  5. +25 −0 CONTRIBUTING.md
  6. +2 −2 LICENSE
  7. +139 −61 README.md
  8. +250 −0 README_CN.md
  9. +2 −4 example/index.js
  10. +30 −2 example/main-viewport.css
  11. +29 −0 example/main.css
  12. +138 −54 index.js
  13. +4,791 −0 package-lock.json
  14. +11 −8 package.json
  15. +351 −77 spec/px-to-viewport.spec.js
  16. +14 −0 src/pixel-unit-regexp.js
  17. +76 −76 src/prop-list-matcher.js
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -3,4 +3,5 @@ logs
*.log
npm-debug.log*
node_modules
postcss-px-to-em-master
.idea
yarn.lock
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -3,3 +3,4 @@
npm-debug.log*
node_modules
spec
package-lock.json
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased 1.2.0] - 2020-xx-xx

You can install edge-version over
`npm i -D evrone/postcss-px-to-viewport` or `yarn add -D evrone/postcss-px-to-viewport`.

### Added
- [#50](https://github.com/evrone/postcss-px-to-viewport/pull/50) by [@IceApriler](https://github.com/IceApriler):
`include` (Regexp or Array of Regexp) If `include` is set, only matching files will be converted,
for example, only files under `src/mobile/` (`include: /\/src\/mobile\//`)
> `exclude` and `include` can be set together, and the intersection of the two rules will be taken.
- Added `/* px-to-viewport-ignore */` and `/* px-to-viewport-ignore-next */` — special comments
for ignore conversion of single lines, inspired by
[#27](https://github.com/evrone/postcss-px-to-viewport/pull/27) from [@lcat](https://github.com/lcat)
[Read more about ignoring](https://github.com/evrone/postcss-px-to-viewport#ignoring).

### Changed
- Changed testing lib to [Jest](https://github.com/facebook/jest)
from [jasmine-node](https://github.com/mhevery/jasmine-node).
- `package-lock.json` included to git-repo.

## [1.1.1] - 2019-07-08

### Fixed
- Fixed `rule.source === undefined` from `postcss-modules-values`.

## [1.1.0] - 2019-02-05

### Added
- `landscape` (Boolean) Adds `@media (orientation: landscape)` with values converted via `landscapeWidth`.
- `landscapeUnit` (String) Expected unit for `landscape` option
- `landscapeWidth` (Number) Viewport width for landscape orientation.

### Fixed
- `mediaQuery` option if `true` does not mutate its value now, but the rule inside it instead.

## [1.0.0] - 2019-01-28

### Added
- `replace` option - (Boolean) replaces rules containing `vw` instead of adding fallbacks.
- `propList` option - (Array) The properties that can change from `px` to `vw`.
- `exclude` option - (Array or Regexp) Ignore some files like `node_modules`.

### Changed
- zero values now remain unitless.
- replace regexp is now case sensitive, so if you want to change `px`, then `pX` values won't be changed.
74 changes: 74 additions & 0 deletions CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at codeofconduct@evrone.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributing Guidelines

Thanks for taking the time to contribute!

The following is a set of guidelines for contributing to this project. These are just guidelines, not rules, so use your best judgement and feel free to propose changes to this document in a pull request.

## Reporting issues

Ensure the bug was not already reported by searching on GitHub under issues. If you're unable to find an open issue addressing the bug, open a new issue.

Please pay attention to the following points while opening an issue:
* How to reproduce the issue, step-by-step.
* The expected behavior (or what is wrong).
* Screenshots for GUI issues.
* The application version.
* The operating system.

## Pull Requests

Pull Requests are always welcome.

1. When you edit the code, please check the formatting of your code before you `git commit`.
2. Ensure the PR description clearly describes the problem and solution. It should include:
* The operating system on which you tested.
* The relevant issue number, if applicable.
4 changes: 2 additions & 2 deletions LICENSE
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)
MIT License

Copyright (c) 2016 Dmitry Karpunin <koderfunk@gmail.com>
Copyright (c) 2016-2020 Dmitry Karpunin <koderfunk@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Loading