Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-browser-comments

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-browser-comments - npm Package Compare versions

Comparing version 4.0.0 to 5.0.0

dist/index.cjs

22

CHANGELOG.md
# Changes to PostCSS Browser Comments
### 4.0.0 (April 28, 2021)
### 5.0.0
- Updated: PostCSS 8 compatibility (major)
_May 12, 2024_
### 3.0.0 (May 24, 2019)
- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/))
- Updated: Node 14+ compatibility (major)
- Updated: Node 8+ compatibility (major)
### 4.0.0
_April 28, 2021_
### 2.0.0 (September 6, 2018)
- Updated: PostCSS 8 compatibility (major)
- Update to PostCSS 7.0.2 (major)
- Update to browserslist 4.1.1 (major)
### 3.0.0
### 1.0.0 (June 15, 2018)
_May 24, 2019_
- Initial version
- Updated: Node 8+ compatibility (major)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-browser-comments/CHANGELOG.md)

@@ -1,108 +0,18 @@

# CC0 1.0 Universal
MIT No Attribution (MIT-0)
## Statement of Purpose
Copyright © CSSTools Contributors
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an “owner”) of an original work of
authorship and/or a database (each, a “Work”).
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so.
Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific works
(“Commons”) that the public can reliably and without fear of later claims of
infringement build upon, modify, incorporate in other works, reuse and
redistribute as freely as possible in any form whatsoever and for any purposes,
including without limitation commercial purposes. These owners may contribute
to the Commons to promote the ideal of a free culture and the further
production of creative, cultural and scientific works, or to gain reputation or
greater distribution for their Work in part through the use and efforts of
others.
For these and/or other purposes and motivations, and without any expectation of
additional consideration or compensation, the person associating CC0 with a
Work (the “Affirmer”), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and
publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights (“Copyright and
Related Rights”). Copyright and Related Rights include, but are not limited
to, the following:
1. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;
2. moral rights retained by the original author(s) and/or performer(s);
3. publicity and privacy rights pertaining to a person’s image or likeness
depicted in a Work;
4. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(i), below;
5. rights protecting the extraction, dissemination, use and reuse of data in
a Work;
6. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation thereof,
including any amended or successor version of such directive); and
7. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations
thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the “Waiver”). Affirmer
makes the Waiver for the benefit of each member of the public at large and
to the detriment of Affirmer’s heirs and successors, fully intending that
such Waiver shall not be subject to revocation, rescission, cancellation,
termination, or any other legal or equitable action to disrupt the quiet
enjoyment of the Work by the public as contemplated by Affirmer’s express
Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer’s express Statement of Purpose. In addition, to the extent the
Waiver is so judged Affirmer hereby grants to each affected person a
royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer’s Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the “License”). The License
shall be deemed effective as of the date CC0 was applied by Affirmer to the
Work. Should any part of the License for any reason be judged legally
invalid or ineffective under applicable law, such partial invalidity or
ineffectiveness shall not invalidate the remainder of the License, and in
such case Affirmer hereby affirms that he or she will not (i) exercise any
of his or her remaining Copyright and Related Rights in the Work or (ii)
assert any associated claims and causes of action with respect to the Work,
in either case contrary to Affirmer’s express Statement of Purpose.
4. Limitations and Disclaimers.
1. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
2. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or
otherwise, including without limitation warranties of title,
merchantability, fitness for a particular purpose, non infringement, or
the absence of latent or other defects, accuracy, or the present or
absence of errors, whether or not discoverable, all to the greatest
extent permissible under applicable law.
3. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person’s Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the Work.
4. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to this
CC0 or use of the Work.
For more information, please see
http://creativecommons.org/publicdomain/zero/1.0/.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
"name": "postcss-browser-comments",
"version": "4.0.0",
"description": "Keep only the CSS you need based on comments and your browserslist",
"author": "Jonathan Neal <csstools@hotmail.com>",
"license": "CC0-1.0",
"repository": "csstools/postcss-browser-comments",
"homepage": "https://github.com/csstools/postcss-browser-comments#readme",
"bugs": "https://github.com/csstools/postcss-browser-comments/issues",
"main": "index.cjs",
"module": "index.mjs",
"files": [
"index.cjs",
"index.cjs.map",
"index.mjs",
"index.mjs.map"
],
"scripts": {
"prepublishOnly": "npm test",
"build": "rollup --config .rollup.js --silent",
"lint": "eslint *.js --cache --ignore-path .gitignore --quiet",
"test": "npm run lint && npm run build && npm run tape",
"tape": "postcss-tape"
},
"engines": {
"node": ">=8"
},
"peerDependencies": {
"browserslist": ">=4",
"postcss": ">=8"
},
"devDependencies": {
"@babel/core": "7.13.16",
"@babel/preset-env": "7.13.15",
"browserslist": "4.1.1",
"eslint": "7.25.0",
"postcss": "8.2.13",
"postcss-tape": "6.0.1",
"pre-commit": "1.2.2",
"rollup": "2.46.0",
"rollup-plugin-babel": "4.3.2"
},
"eslintConfig": {
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"ecmaFeatures": {
"modules": true
}
},
"rules": {
"semi": [
"error",
"never"
]
}
},
"keywords": [
"postcss",
"css",
"postcss-plugin",
"browserslists",
"browserlists",
"browsers",
"lists",
"support",
"caniuse",
"target"
]
"name": "postcss-browser-comments",
"description": "Keep only the CSS you need based on comments and your browserslist",
"version": "5.0.0",
"contributors": [
{
"name": "Antonio Laguna",
"email": "antonio@laguna.es",
"url": "https://antonio.laguna.es"
},
{
"name": "Jonathan Neal",
"email": "csstools@hotmail.com"
},
{
"name": "Romain Menke",
"email": "romainmenke@gmail.com"
}
],
"license": "MIT-0",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/csstools"
},
{
"type": "opencollective",
"url": "https://opencollective.com/csstools"
}
],
"engines": {
"node": "^14 || ^16 || >=18"
},
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
},
"require": {
"default": "./dist/index.cjs"
}
}
},
"files": [
"CHANGELOG.md",
"LICENSE.md",
"README.md",
"dist"
],
"peerDependencies": {
"browserslist": "^4.23.0",
"postcss": "^8.4"
},
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-browser-comments#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-browser-comments"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
"keywords": [
"browserlists",
"browsers",
"browserslists",
"caniuse",
"css",
"lists",
"postcss",
"postcss-plugin",
"support",
"target"
]
}

@@ -1,11 +0,14 @@

# PostCSS Browser Comments [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss]
# PostCSS Browser Comments [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]
[![NPM Version][npm-img]][npm-url]
[![Build Status][cli-img]][cli-url]
[![Support Chat][git-img]][git-url]
[<img alt="npm version" src="https://img.shields.io/npm/v/postcss-browser-comments.svg" height="20">][npm-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
```bash
npm install postcss-browser-comments --save-dev
```
[PostCSS Browser Comments] lets you keep only the CSS you need based on
comments and your [browserslist].
comments and your [browserslist](https://github.com/browserslist/browserslist).
```css
```pcss
/**

@@ -19,2 +22,6 @@ * Prevent adjustments of font size after orientation changes in IE and iOS.

}
/* becomes */
```

@@ -30,3 +37,3 @@

```css
```pcss
/**

@@ -56,9 +63,2 @@ * 1. Add the correct box sizing in Firefox.

---
[PostCSS Browser Comments] can remove rules based upon the comment above them,
or it can remove declarations using numbered comments that reference the rule
above them. In the later case, when all of the numbered comments are removed,
then the entire rule and comment are also removed.
## Usage

@@ -72,13 +72,5 @@

Use [PostCSS Browser Comments] to process your CSS:
Use it as a [PostCSS] plugin:
```js
const postcssBrowserComments = require('postcss-browser-comments');
postcssBrowserComments.process(YOUR_CSS /*, processOptions, pluginOptions */);
```
Or use it as a [PostCSS] plugin:
```js
const postcss = require('postcss');

@@ -88,10 +80,16 @@ const postcssBrowserComments = require('postcss-browser-comments');

postcss([
postcssBrowserComments(/* pluginOptions */)
postcssBrowserComments(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
```
[PostCSS Browser Comments] runs in all Node environments, with special instructions for:
[PostCSS Browser Comments] runs in all Node environments, with special
instructions for:
| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
| --- | --- | --- | --- | --- | --- |
- [Node](INSTALL.md#node)
- [PostCSS CLI](INSTALL.md#postcss-cli)
- [PostCSS Load Config](INSTALL.md#postcss-load-config)
- [Webpack](INSTALL.md#webpack)
- [Next.js](INSTALL.md#nextjs)
- [Gulp](INSTALL.md#gulp)
- [Grunt](INSTALL.md#grunt)

@@ -105,16 +103,11 @@ ## Options

```js
postcssBrowserComments({
browsers: 'last 2 versions'
});
postcssBrowserComments({ browsers: 'last 2 versions' })
```
[cli-img]: https://img.shields.io/travis/csstools/postcss-browser-comments/main.svg
[cli-url]: https://travis-ci.org/csstools/postcss-browser-comments
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
[git-url]: https://gitter.im/postcss/postcss
[npm-img]: https://img.shields.io/npm/v/postcss-browser-comments.svg
[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
[discord]: https://discord.gg/bUadyRwkJS
[npm-url]: https://www.npmjs.com/package/postcss-browser-comments
[browserslist]: https://github.com/browserslist/browserslist
[PostCSS]: https://github.com/postcss/postcss
[PostCSS Browser Comments]: https://github.com/csstools/postcss-browser-comments
[PostCSS Browser Comments]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-browser-comments
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc