Skip to content

Commit

Permalink
Stop polyfilling the CSS calc functionality
Browse files Browse the repository at this point in the history
At this point in time, all browsers that we support have native support for CSS variables; please see https://developer.mozilla.org/en-US/docs/Web/CSS/calc()#browser_compatibility and https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support

We can also remove the hack introduced back in PR 11567, which was only necessary to work-around an IE 11 specific bug.
  • Loading branch information
Snuffleupagus committed Mar 19, 2022
1 parent 079dea2 commit 502fd7c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 31 deletions.
4 changes: 0 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"use strict";

const autoprefixer = require("autoprefixer");
const postcssCalc = require("postcss-calc");
const postcssDirPseudoClass = require("postcss-dir-pseudo-class");
const postcssLogical = require("postcss-logical");
const fs = require("fs");
Expand Down Expand Up @@ -853,7 +852,6 @@ function buildGeneric(defines, dir) {
preprocessCSS("web/viewer.css", defines)
.pipe(
postcss([
postcssCalc(),
postcssLogical({ preserve: true }),
postcssDirPseudoClass(),
autoprefixer(AUTOPREFIXER_CONFIG),
Expand Down Expand Up @@ -936,7 +934,6 @@ function buildComponents(defines, dir) {
preprocessCSS("web/pdf_viewer.css", defines)
.pipe(
postcss([
postcssCalc(),
postcssLogical({ preserve: true }),
postcssDirPseudoClass(),
autoprefixer(AUTOPREFIXER_CONFIG),
Expand Down Expand Up @@ -1033,7 +1030,6 @@ function buildMinified(defines, dir) {
preprocessCSS("web/viewer.css", defines)
.pipe(
postcss([
postcssCalc(),
postcssLogical({ preserve: true }),
postcssDirPseudoClass(),
autoprefixer(AUTOPREFIXER_CONFIG),
Expand Down
24 changes: 0 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"mkdirp": "^1.0.4",
"needle": "^3.0.0",
"postcss": "^8.4.7",
"postcss-calc": "^8.2.4",
"postcss-dir-pseudo-class": "^6.0.4",
"postcss-logical": "^5.0.4",
"prettier": "^2.5.1",
Expand Down
4 changes: 2 additions & 2 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ select {
}
html[dir="ltr"] #sidebarContainer {
transition-property: left;
left: calc(0px - var(--sidebar-width));
left: calc(-1 * var(--sidebar-width));
border-right: var(--doorhanger-border-color-whcm);
}
html[dir="rtl"] #sidebarContainer {
transition-property: right;
right: calc(0px - var(--sidebar-width));
right: calc(-1 * var(--sidebar-width));
border-left: var(--doorhanger-border-color-whcm);
}

Expand Down

0 comments on commit 502fd7c

Please sign in to comment.