Skip to content

Commit 248201f

Browse files
authored
add support for custom css style (#1298)
* add support for custom css style * move custom sass file in private folder * rquested fixes
1 parent ceab79a commit 248201f

File tree

7 files changed

+48
-3
lines changed

7 files changed

+48
-3
lines changed

assets/sass/framework.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@
3434
// Themes
3535
@use 'themes/classic';
3636
@use 'themes/modern';
37+
38+
// Custom CSS
39+
@use '../../private/sass/custom';

docs/configuration/index.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/customizing/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Customizing
2+
3+
## [Sounds](sounds.md)
4+
## [Customizing SCSS styles](styles.md)
File renamed without changes.

docs/customizing/styles.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Customizing SCSS styles
2+
3+
Photobooth uses a small SCSS build pipeline based on `gulp` and `sass`. You can add your own styles that will be compiled to CSS and loaded together with the default styles.
4+
5+
## Recommended: `_custom.scss` (loaded automatically)
6+
7+
This means:
8+
9+
- If `private/sass/_custom.scss` exists, it is automatically imported into `framework.scss`.
10+
- No template changes are needed – your styles are bundled into `resources/css/framework.css`, which is already loaded by Photobooth.
11+
12+
To use this:
13+
14+
1. Create a new file called `_custom.scss` in `private/sass`.
15+
2. Add your overrides or additional styles to this file.
16+
17+
## Building the CSS
18+
19+
From the project root run:
20+
21+
- `npm install` (first time only, to install Node.js dependencies)
22+
- `npm run build:sass` to only compile SCSS, or
23+
- `npm run build` to run the full asset build (SCSS, JS, etc.).

gulpfile.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ gulp.task('sass', async function () {
2121
try {
2222
const scssDir = './assets/sass';
2323
const outputDir = './resources/css';
24+
25+
const privateScssDir = './private/sass';
26+
27+
// Ensure the private sass directory exists
28+
fs.mkdirSync(privateScssDir, { recursive: true });
29+
// Create an optional _custom.scss file if it doesn't exist
30+
const optionalCustomCss = path.join(privateScssDir, '_custom.scss');
31+
if (!fs.existsSync(optionalCustomCss)) {
32+
fs.writeFileSync(
33+
optionalCustomCss,
34+
'// auto-generated stub for optional custom overrides\n'
35+
);
36+
}
37+
2438
const files = fs.readdirSync(scssDir);
2539

2640
const scssFiles = files.filter(file => path.extname(file) === '.scss' && file !== 'tailwind.admin.scss');

mkdocs_remote.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ nav:
3939
- gphoto2 Troubleshooting: faq/gphoto2-troubleshooting.md
4040
- GO2RTC Troubleshooting: faq/go2rtc-troubleshooting.md
4141
- Tutorials: faq/tutorials.md
42+
- Customizing:
43+
- Overview: customizing/index.md
44+
- Sounds: customizing/sounds.md
45+
- CSS styles: customizing/styles.md
4246
- Community & Contribution:
4347
- Chat on Telegram: https://t.me/PhotoboothGroup
4448
- Contributor Covenant Code of Conduct: code_of_conduct.md

0 commit comments

Comments
 (0)