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: postcss/autoprefixer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 10.2.6
Choose a base ref
...
head repository: postcss/autoprefixer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 10.3.0
Choose a head ref
  • 5 commits
  • 10 files changed
  • 3 contributors

Commits on Jul 5, 2021

  1. Fix: remove broken link with 404 error (#1410)

    When you hit the link, it takes you to the Google developers page, but you can't find the referenced page, it looks like the setup/configuration section where they recommended using the autoprefixer has been removed.
    
    [![Image from Gyazo](https://i.gyazo.com/55aeedd59c7a318b3631ccbaef235835.png)](https://gyazo.com/55aeedd59c7a318b3631ccbaef235835)
    ThesllaDev authored Jul 5, 2021
    Copy the full SHA
    05cfed6 View commit details

Commits on Jul 10, 2021

  1. Autoprefix the file-selector-button pseudo-element (#1412)

    * Autoprefix the file-selector-button pseudo-element
    
    Prototype using MDN compat data where caniuse is not usable.
    
    * Hardcode data instead of using MDN
    
    * Add test to hacks block
    lukewarlow authored Jul 10, 2021
    Copy the full SHA
    5468c9f View commit details
  2. Update dependencies

    ai committed Jul 10, 2021
    Copy the full SHA
    9a114c5 View commit details
  3. Clean up dependencies

    ai committed Jul 10, 2021
    Copy the full SHA
    5f9a9b5 View commit details
  4. Release 10.3 version

    ai committed Jul 10, 2021
    Copy the full SHA
    006146d View commit details
Showing with 1,108 additions and 1,069 deletions.
  1. +3 −0 CHANGELOG.md
  2. +1 −2 README.md
  3. +19 −0 data/prefixes.js
  4. +17 −0 lib/hacks/file-selector-button.js
  5. +2 −0 lib/prefixes.js
  6. +18 −19 package.json
  7. +8 −0 test/autoprefixer.test.ts
  8. +3 −0 test/cases/file-selector-button.css
  9. +6 −0 test/cases/file-selector-button.out.css
  10. +1,031 −1,048 yarn.lock
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).

## 10.3 “Чести своей не отдам никому”
* Added `::file-selector-button` support (by Luke Warlow).

## 10.2.6
* Fixed “no prefixes needed” warning (by @Pwntheon).

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
title="Autoprefixer logo by Anton Lovchikov">

[PostCSS] plugin to parse CSS and add vendor prefixes to CSS rules using values
from [Can I Use]. It is [recommended] by Google and used in Twitter and Alibaba.
from [Can I Use]. It is recommended by Google and used in Twitter and Alibaba.

Write your CSS rules without vendor prefixes (in fact, forget about them
entirely):
@@ -59,7 +59,6 @@ Twitter account for news and releases: [@autoprefixer].

[interactive demo]: https://autoprefixer.github.io/
[@autoprefixer]: https://twitter.com/autoprefixer
[recommended]: https://developers.google.com/web/tools/setup/setup-buildtools#dont_trip_up_with_vendor_prefixes
[Can I Use]: https://caniuse.com/
[cult-img]: http://cultofmartians.com/assets/badges/badge.svg
[PostCSS]: https://github.com/postcss/postcss
19 changes: 19 additions & 0 deletions data/prefixes.js
Original file line number Diff line number Diff line change
@@ -521,6 +521,25 @@ f(prefixFullscreen, { match: /x(\s#2|$)/ }, browsers =>
})
)

// File selector button
prefix(['::file-selector-button'], {
selector: true,
feature: 'fullscreen',
browsers: [
'chrome 89',
'edge 89',
'firefox 82',
'opera 75',
'safari 14.1',
'android 89',
'and_chr 89',
'op_mob 63',
'and_ff 82',
'ios_saf 14.5',
'samsung 15.0'
]
})

// Tab size
let prefixTabsize = require('caniuse-lite/data/features/css3-tabsize')

17 changes: 17 additions & 0 deletions lib/hacks/file-selector-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
let Selector = require('../selector')

class FileSelectorButton extends Selector {
/**
* Return different selectors depend on prefix
*/
prefixed(prefix) {
if (prefix === '-webkit-') {
return '::-webkit-file-upload-button'
}
return `::file-selector-button`
}
}

FileSelectorButton.names = ['::file-selector-button']

module.exports = FileSelectorButton
2 changes: 2 additions & 0 deletions lib/prefixes.js
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ let utils = require('./utils')
let hackFullscreen = require('./hacks/fullscreen')
let hackPlaceholder = require('./hacks/placeholder')
let hackPlaceholderShown = require('./hacks/placeholder-shown')
let hackFileSelectorButton = require('./hacks/file-selector-button')
let hackFlex = require('./hacks/flex')
let hackOrder = require('./hacks/order')
let hackFilter = require('./hacks/filter')
@@ -68,6 +69,7 @@ let hackFilterValue = require('./hacks/filter-value')
Selector.hack(hackFullscreen)
Selector.hack(hackPlaceholder)
Selector.hack(hackPlaceholderShown)
Selector.hack(hackFileSelectorButton)
Declaration.hack(hackFlex)
Declaration.hack(hackOrder)
Declaration.hack(hackFilter)
37 changes: 18 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autoprefixer",
"version": "10.2.6",
"version": "10.3.0",
"description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website",
"engines": {
"node": "^10 || ^12 || >=14"
@@ -30,7 +30,7 @@
},
"dependencies": {
"browserslist": "^4.16.6",
"caniuse-lite": "^1.0.30001230",
"caniuse-lite": "^1.0.30001243",
"colorette": "^1.2.2",
"fraction.js": "^4.1.1",
"normalize-range": "^0.1.2",
@@ -41,31 +41,30 @@
"chalk": false
},
"devDependencies": {
"@logux/eslint-config": "^45.4.3",
"@size-limit/preset-small-lib": "4.11.0",
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"check-dts": "^0.4.4",
"@logux/eslint-config": "^45.4.6",
"@size-limit/preset-small-lib": "5.0.1",
"@types/jest": "^26.0.24",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"check-dts": "^0.5.2",
"clean-publish": "^2.2.0",
"eslint": "^7.27.0",
"eslint": "^7.30.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prefer-let": "^1.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-unicorn": "^32.0.1",
"fs-extra": "^9.1.0",
"jest": "^27.0.1",
"eslint-plugin-unicorn": "^34.0.1",
"jest": "^27.0.6",
"lint-staged": "^11.0.0",
"postcss": "^8.3.0",
"prettier": "^2.3.0",
"simple-git-hooks": "^2.4.1",
"size-limit": "^4.11.0",
"ts-jest": "^27.0.0",
"typescript": "^4.2.4"
"postcss": "^8.3.5",
"prettier": "^2.3.2",
"simple-git-hooks": "^2.5.1",
"size-limit": "^5.0.1",
"ts-jest": "^27.0.3",
"typescript": "^4.3.5"
},
"lint-staged": {
"*.js": [
8 changes: 8 additions & 0 deletions test/autoprefixer.test.ts
Original file line number Diff line number Diff line change
@@ -56,6 +56,9 @@ let ffgradienter = autoprefixer({
let selectorer = autoprefixer({
overrideBrowserslist: ['Chrome 25', 'Firefox > 17', 'IE 10', 'Edge 12']
})
let fileSelectorButtoner = autoprefixer({
overrideBrowserslist: ['Chrome > 25', 'Firefox > 85']
})
let placeholderShowner = autoprefixer({
overrideBrowserslist: ['IE >= 10']
})
@@ -123,6 +126,8 @@ function prefixer(name: string): Plugin {
return intrinsicer
} else if (name === 'selectors' || name === 'placeholder') {
return selectorer
} else if (name === 'selectors' || name === 'file-selector-button') {
return fileSelectorButtoner
} else if (name === 'placeholder-shown') {
return placeholderShowner
} else if (name === 'backdrop-filter' || name === 'overscroll-behavior') {
@@ -680,6 +685,9 @@ describe('hacks', () => {
it('supports all fullscreens', () => {
check('fullscreen')
})
it('supports file-selector-button', () => {
check('file-selector-button')
})
it('supports custom prefixes', () => {
check('custom-prefix')
})
3 changes: 3 additions & 0 deletions test/cases/file-selector-button.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
::file-selector-button {
background: black
}
6 changes: 6 additions & 0 deletions test/cases/file-selector-button.out.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
::-webkit-file-upload-button {
background: black
}
::file-selector-button {
background: black
}
Loading