Skip to content

Commit

Permalink
fix: do my best to tame the SCSS (Paragon was included dozens of times)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Apr 24, 2024
1 parent 141bf7c commit f44bb0a
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import AppWrapper from '@/containers/WidgetContainers/AppWrapper';
import LearnerDashboardHeader from '@/containers/LearnerDashboardHeader';

import messages from './messages';
import './App.scss';

export const App = () => {
const { authenticatedUser } = React.useContext(AppContext);
Expand Down
7 changes: 5 additions & 2 deletions src/App.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
@import "./variables.scss";

$fa-font-path: "@font-awesome/fonts";
@import "@font-awesome/scss/font-awesome";
$input-focus-box-shadow: $input-box-shadow; // hack to get upgrade to paragon 4.0.0 to work
@import "font-awesome/scss/font-awesome";
@import "@openedx/paragon/src/Form/_variables.scss"; // for $input-box-shadow. TODO: fix this so it's included in Paragon root variables export
$input-focus-box-shadow: $input-box-shadow;

.text-ellipsis {
overflow: hidden;
Expand Down
4 changes: 3 additions & 1 deletion src/containers/CourseCard/CourseCard.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@import "@openedx/paragon/scss/core/core";
@import "../../variables.scss";
@import "@openedx/paragon/src/Card/_variables.scss"; // TODO: fix paragon so these are included in the root vars export
@import "@openedx/paragon/src/Alert/_variables.scss";

.course-card {
.card {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import "~@edx/brand/paragon/variables";
@import "~@openedx/paragon/scss/core/core";
@import "~@edx/brand/paragon/overrides";
@import "../../../../variables.scss";


a.course-card-title {
color: $black;
Expand Down
2 changes: 1 addition & 1 deletion src/containers/CoursesPanel/NoCoursesView/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "@openedx/paragon/scss/core/core";
@import "../../../variables.scss";

#no-courses-content-view {
border: 2px solid $light-400;
Expand Down
2 changes: 1 addition & 1 deletion src/containers/CoursesPanel/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "@openedx/paragon/scss/core/core";
@import "../../variables.scss";

.course-list-heading-container {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Dashboard/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "@openedx/paragon/scss/core/core";
@import "../../variables.scss";

.course-list-column {
padding: 0 map-get($spacers, 4);
Expand Down
2 changes: 1 addition & 1 deletion src/containers/MasqueradeBar/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "@openedx/paragon/scss/core/core";
@import "../../variables.scss";

.masquerade-bar {
display: flex;
Expand Down
1 change: 0 additions & 1 deletion src/embed-learner-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import store from './data/store';

import App from './App';
import NoticesWrapper from './components/NoticesWrapper';
import './embed.scss';

export const LearnerDashboardApp = () => {

Expand Down
2 changes: 0 additions & 2 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
@import "~@openedx/paragon/scss/core/core";
@import "~@edx/brand/paragon/overrides";
@import "~@edx/frontend-component-footer/dist/_footer";

@import "./App";
5 changes: 2 additions & 3 deletions src/embed-learner-dashboard.scss → src/variables.scss
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// This imports all the [theme] variables, mixins, and functions that our SCSS files need,
// but doesn't define any rules, because doing so would result in duplicate rules in the bundle.
@import "@edx/brand/paragon/variables";
// We need the Paragon variables and mixins, but we don't want any actual rules since those are provided by the shell.
// TODO: there should be a public export for this that doesn't rely on these internal _private files.
@import "@openedx/paragon/scss/core/_functions";
@import "@openedx/paragon/scss/core/_variables";
@import "~bootstrap/scss/mixins";

@import './App';
2 changes: 1 addition & 1 deletion src/widgets/ProductRecommendations/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "@openedx/paragon/scss/core/core";
@import "../../variables.scss";

$horizontal-card-gap: 20px;
$vertical-card-gap: 24px;
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/RecommendationsPanel/components/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "@openedx/paragon/scss/core/core";
@import "../../../variables.scss";

.card-link{
display: block !important;
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/RecommendationsPanel/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "@openedx/paragon/scss/core/core";
@import "../../variables.scss";

.explore-courses-btn {
padding-top: 16px;
Expand Down

0 comments on commit f44bb0a

Please sign in to comment.