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

[api-minor] Update the minimum supported browsers, and remove the PostCSS logical plugin #15968

Merged
merged 1 commit into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 6 additions & 21 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

const autoprefixer = require("autoprefixer");
const postcssDirPseudoClass = require("postcss-dir-pseudo-class");
const postcssLogical = require("postcss-logical");
const fs = require("fs");
const gulp = require("gulp");
const postcss = require("gulp-postcss");
Expand Down Expand Up @@ -80,9 +79,9 @@ const config = JSON.parse(fs.readFileSync(CONFIG_FILE).toString());

const ENV_TARGETS = [
"last 2 versions",
"Chrome >= 85",
"Chrome >= 87",
"Firefox ESR",
"Safari >= 14",
"Safari >= 14.1",
"Node >= 14",
"> 1%",
"not IE > 0",
Expand Down Expand Up @@ -912,11 +911,7 @@ function buildGeneric(defines, dir) {
preprocessHTML("web/viewer.html", defines).pipe(gulp.dest(dir + "web")),
preprocessCSS("web/viewer.css", defines)
.pipe(
postcss([
postcssLogical({ preserve: true }),
postcssDirPseudoClass(),
autoprefixer(AUTOPREFIXER_CONFIG),
])
postcss([postcssDirPseudoClass(), autoprefixer(AUTOPREFIXER_CONFIG)])
)
.pipe(gulp.dest(dir + "web")),

Expand Down Expand Up @@ -993,11 +988,7 @@ function buildComponents(defines, dir) {
gulp.src(COMPONENTS_IMAGES).pipe(gulp.dest(dir + "images")),
preprocessCSS("web/pdf_viewer.css", defines)
.pipe(
postcss([
postcssLogical({ preserve: true }),
postcssDirPseudoClass(),
autoprefixer(AUTOPREFIXER_CONFIG),
])
postcss([postcssDirPseudoClass(), autoprefixer(AUTOPREFIXER_CONFIG)])
)
.pipe(gulp.dest(dir)),
]);
Expand Down Expand Up @@ -1089,11 +1080,7 @@ function buildMinified(defines, dir) {
preprocessHTML("web/viewer.html", defines).pipe(gulp.dest(dir + "web")),
preprocessCSS("web/viewer.css", defines)
.pipe(
postcss([
postcssLogical({ preserve: true }),
postcssDirPseudoClass(),
autoprefixer(AUTOPREFIXER_CONFIG),
])
postcss([postcssDirPseudoClass(), autoprefixer(AUTOPREFIXER_CONFIG)])
)
.pipe(gulp.dest(dir + "web")),

Expand Down Expand Up @@ -1435,9 +1422,8 @@ gulp.task(
preprocessCSS("web/viewer.css", defines)
.pipe(
postcss([
postcssLogical({ preserve: true }),
postcssDirPseudoClass(),
autoprefixer({ overrideBrowserslist: ["Chrome >= 85"] }),
autoprefixer({ overrideBrowserslist: ["Chrome >= 87"] }),
])
)
.pipe(gulp.dest(CHROME_BUILD_CONTENT_DIR + "web")),
Expand Down Expand Up @@ -2005,7 +1991,6 @@ gulp.task("dev-css", function createDevCSS() {
preprocessCSS("web/viewer.css", defines)
.pipe(
postcss([
postcssLogical({ preserve: true }),
postcssDirPseudoClass(),
autoprefixer({ overrideBrowserslist: ["last 1 versions"] }),
])
Expand Down
20 changes: 0 additions & 20 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 @@ -42,7 +42,6 @@
"path2d-polyfill": "^2.0.1",
"postcss": "^8.4.21",
"postcss-dir-pseudo-class": "^7.0.0",
"postcss-logical": "^5.0.4",
"prettier": "^2.8.3",
"puppeteer": "^19.0.0",
"rimraf": "^4.1.2",
Expand Down
28 changes: 20 additions & 8 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@

:root {
--dir-factor: 1;
/*#if MOZCENTRAL*/
--inline-start: inline-start;
--inline-end: inline-end;
/*#else*/
--inline-start: left;
--inline-end: right;
/*#endif*/

--sidebar-width: 200px;
--sidebar-transition-duration: 200ms;
--sidebar-transition-timing-function: ease;
Expand Down Expand Up @@ -114,6 +122,10 @@

:root:dir(rtl) {
--dir-factor: -1;
/*#if !MOZCENTRAL*/
--inline-start: right;
--inline-end: left;
/*#endif*/
}

@media (prefers-color-scheme: dark) {
Expand Down Expand Up @@ -658,11 +670,11 @@ body {

#toolbarViewerLeft,
#toolbarSidebarLeft {
float: inline-start;
float: var(--inline-start);
}
#toolbarViewerRight,
#toolbarSidebarRight {
float: inline-end;
float: var(--inline-end);
}

#toolbarViewerLeft > *,
Expand All @@ -672,7 +684,7 @@ body {
#toolbarSidebarRight *,
.findbar * {
position: relative;
float: inline-start;
float: var(--inline-start);
}

#toolbarViewerLeft {
Expand All @@ -690,7 +702,7 @@ body {
display: inline-block;
}
.splitToolbarButton > .toolbarButton {
float: inline-start;
float: var(--inline-start);
}

.toolbarButton,
Expand Down Expand Up @@ -740,7 +752,7 @@ body {
}

.splitToolbarButtonSeparator {
float: inline-start;
float: var(--inline-start);
margin: 4px 0;
width: 1px;
height: 20px;
Expand Down Expand Up @@ -1169,7 +1181,7 @@ a.secondaryToolbarButton[href="#"] {
}

.thumbnail {
float: inline-start;
float: var(--inline-start);
margin: 0 10px 5px;
}

Expand Down Expand Up @@ -1251,13 +1263,13 @@ a:focus > .thumbnail > .thumbnailSelectionRing,
padding-inline-start: 4px;
}
#layersView .treeItem > a > label > input {
float: inline-start;
float: var(--inline-start);
margin-top: 1px;
}

.treeItemToggler {
position: relative;
float: inline-start;
float: var(--inline-start);
height: 0;
width: 0;
color: rgba(255, 255, 255, 0.5);
Expand Down