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

Styles: Less file housecleaning #877

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
5 changes: 5 additions & 0 deletions .changeset/grumpy-icons-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

Remove unused Less variables
2 changes: 1 addition & 1 deletion packages/perseus/src/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ class Renderer extends React.Component<Props, State> {
}
// Widgets can contain text nodes, so we don't center them with
// markdown magic here.
// Instead, we center them with css magic in articles.less
// Instead, we center them with css magic in styles.less
// /cry(aria)
this._foundTextNodes = true;

Expand Down
8 changes: 1 addition & 7 deletions packages/perseus/src/styles/perseus-renderer.less
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
@import (inline) "./khan-exercise.css";

//
// Edit this file in the *perseus* repo!
// (All changes outside the perseus repo will be overwritten)
//

@import "./variables.less";
@import "./util.less";

// Article Renderer
@import "./articles.less";
@import "./styles.less";

#perseus {
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion packages/perseus/src/styles/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default StyleSheet.create({

responsiveLabel: {
// NOTE(charlie): The values used here should be kept in sync with the
// caption text sizing in Perseus' articles.less.
// caption text sizing in Perseus' styles.less.
// TODO(charlie): Migrate the captions over to using this style.
[mediaQueries.smOrSmaller]: {
fontSize: 14,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "./variables.shared.less";
@import "./variables.less";
@import "./util.less";

Expand Down Expand Up @@ -677,73 +676,4 @@
}
}

/* Derived from the MIT-licensed zoom.js:
https://github.com/fat/zoom.js/blob/fd4f3e43153da7596da0bade198e99f98b47791e/
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This chunk of styles was moved to zoom.less

*/

@zoomOverlayZIndex: 9000;
@zoomAnimationDurationMs: 300ms;

.zoomable {
cursor: pointer;
cursor: -webkit-zoom-in;
cursor: -moz-zoom-in;
}

.zoom-img {
// NOTE(charlie): We set the zoomed image's background color to white so
// that any images with transparent backgrounds (like SVGs and some PNGs)
// remain legible over the article content, as our backdrop is opaque.
background-color: white;
position: absolute;
z-index: @zoomOverlayZIndex + 1;
}

img.zoom-img {
cursor: pointer;
cursor: -webkit-zoom-out;
cursor: -moz-zoom-out;
}

.zoom-transition {
transition: transform @zoomAnimationDurationMs ease;
}

.zoom-overlay {
z-index: @zoomOverlayZIndex;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: scroll;
}

.zoom-overlay-open,
.zoom-overlay-transitioning {
cursor: default;
}

// Disable vertical scrolling on the page when image is opened in modal.
.zoom-overlay-open {
height: 100%;
max-height: 100%;
overflow: hidden;
}

// Render an opaque backdrop upon zoom.
.zoom-backdrop {
z-index: @zoomOverlayZIndex - 1;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: white;
opacity: 0;
transition: opacity @zoomAnimationDurationMs;
}

.zoom-overlay-open > .zoom-backdrop {
opacity: 0.9;
}
@import "./zoom.less";
277 changes: 0 additions & 277 deletions packages/perseus/src/styles/variables.boostrap.less

This file was deleted.