Skip to content

Commit

Permalink
feat: initial setup for dark theme
Browse files Browse the repository at this point in the history
  • Loading branch information
hinakhadim committed Apr 8, 2024
1 parent 294ccde commit c10880b
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 1 deletion.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"homepage": "https://github.com/edly-io/brand-openedx#readme",
"publishConfig": {
"access": "public"
},
"scripts": {
"postinstall": "node postinstall.js"
}
}
Empty file added paragon/_extras.scss
Empty file.
4 changes: 3 additions & 1 deletion paragon/_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2874,4 +2874,6 @@ div[role=heading].h2 + .list-unstyled.m-0.mt-4.pt-2 {
}
}
}
}
}

@import './extras';
31 changes: 31 additions & 0 deletions postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const fs = require("fs");
const path = require('path');

const themesSupported = ["dark"]
let theme = process.env.npm_config_theme;

// INFO: writing copyDirectorySync instead of using fs-extra package because we don't want to have any npm dependency in brand-openedx
function copyDirectorySync(source, destination) {
if (!fs.existsSync(destination)) {
fs.mkdirSync(destination);
}

const files = fs.readdirSync(source);

files.forEach(file => {
const sourcePath = path.join(source, file);
const destPath = path.join(destination, file);

if (fs.statSync(sourcePath).isDirectory()) {
copyDirectorySync(sourcePath, destPath);
} else {
fs.copyFileSync(sourcePath, destPath);
}
});
}

if (themesSupported.includes(theme)){
const srcDir = path.resolve(__dirname, 'themes', theme);
const destDir = path.resolve(__dirname, 'paragon');
copyDirectorySync(srcDir, destDir);
}
5 changes: 5 additions & 0 deletions themes/dark/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$primary: #15376D;
$primary-light: #F2F7F8;
$light-drak: #374151;

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

0 comments on commit c10880b

Please sign in to comment.