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

Use bootstrap variables to create Bs4-theme #75

Closed

Conversation

GeoSot
Copy link

@GeoSot GeoSot commented Jun 28, 2021

Draft idea, using bootstrap initial variables to create theme.

/CC: @limonte In order to work, needs to take a decision.

  • add a breaking change on next version where scss project needs to consume another file
  • make an extra file (par example build.scss) for each theme, and use this for gulp tasks in order to build the css. (no breaking changes)
  • glob dirs in order to check for build or default files and use the proper one

IMO I would use the second option.

You may feel free to change and commit on this branch (or close the MR :wink)

closes #73


Plus some improvement proposals for gulpFile
You can use the following to replace themes

const excludeDirectories=['.git','.idea','.netlify','node_modules','dist','tools'];
let dirs = fs
  .readdirSync(path.join(__dirname, '/'))
  .filter(path => fs.statSync(path).isDirectory())
  .filter(dir => dir.indexOf('.') !== 0)
  .filter(dir => excludeDirectories.indexOf(dir) === -1)


const sassFiles= dirs.map(dir =>glob(`${dir}/*.scss`,function (er, files) {
  
}))

OR

const excludeDirectories='(.git|.idea|.netlify|node_modules|dist|tools)'
const sassFiles= dirs.map(dir =>glob(`${dir}/*.scss`,function (er, files) {

}))

Limon Monte and others added 30 commits February 17, 2018 13:12
Initial version of sweetalert2-themes
Added:
* (saas) `compile`
* `minify`
* `launchServer`
* Added dark team page link

* First commit for dark theme

It contains only colors for:
* Background
* Backdrop
* Content and Title

* Remove trailing spaces

* Adjust footer color

* Update to latest version of Sweetalert2

* Add test Swals

* Add correct color for input types

Note that there is a temporary workaround for the lack of a variable
for some input types (to be added in main SweetAlert2 repo)

* Add tests for buttons and input types

* Fix (almost all) SCSS linter warning

The "!important" warning is still there. Will be partially fixed when
new SCSS variable are created in main repo

* Fix Swal variable typo (lowercase)

* Remove temp workarounds and use $swal2-input-color

* Add workaround for range / radio / checkbox

* Add dark theme for queue steps

* Add test for queues

* chore: bump sweetalert to 8.9.0
# 1.0.0 (2019-04-28)

### Features

* Dark Theme ⚫ ([sweetalert2#2](sweetalert2#2)) ([bfdb3cb](sweetalert2@bfdb3cb))
## [1.0.1](sweetalert2/sweetalert2-themes@v1.0.0...v1.0.1) (2019-04-29)

### Bug Fixes

* automatically publish all themes ([sweetalert2#3](sweetalert2#3)) ([fee83e1](sweetalert2@fee83e1))
## [1.0.2](sweetalert2/sweetalert2-themes@v1.0.1...v1.0.2) (2019-04-29)

### Bug Fixes

* specify theme directory for npm publish ([03a95e1](sweetalert2@03a95e1))
## [1.0.3](sweetalert2/sweetalert2-themes@v1.0.2...v1.0.3) (2019-04-29)

### Bug Fixes

* use tilde instead of relative path in [@import](https://github.com/import) ([8fdedd5](sweetalert2@8fdedd5))
* Fix for backdrop opacity

Note that the opacity set for the dark theme (75%) is higher than the
equivalent standard opacity (40%).
his is done in pourpose

* Add text to test page

In order to test backdrop opacity
Limon Monte and others added 24 commits January 25, 2021 15:41
## [4.0.2](sweetalert2/sweetalert2-themes@v4.0.1...v4.0.2) (2021-01-25)

### Bug Fixes

* bump sweetalert2 to latest ([f2fc326](sweetalert2@f2fc326))
## [4.0.3](sweetalert2/sweetalert2-themes@v4.0.2...v4.0.3) (2021-02-18)

### Bug Fixes

* bump sweetalert2 to latest ([2174654](sweetalert2@2174654))
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
## [4.0.4](sweetalert2/sweetalert2-themes@v4.0.3...v4.0.4) (2021-04-19)

### Bug Fixes

* bump sweetalert2 to latest ([cee4665](sweetalert2@cee4665))
## [4.0.5](sweetalert2/sweetalert2-themes@v4.0.4...v4.0.5) (2021-04-19)

### Bug Fixes

* bump sweetalert2 to latest ([c1790aa](sweetalert2@c1790aa))
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
BREAKING CHANGE: Upgrade to SweetAlert v11
# [5.0.0](sweetalert2/sweetalert2-themes@v4.0.5...v5.0.0) (2021-05-16)

* BREAKING CHANGE: Upgrade to SweetAlert v11 ([c446447](sweetalert2@c446447))

### BREAKING CHANGES

* Upgrade to SweetAlert v11
* Update all Yarn dependencies (2021-05-31)

* bump

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Limon Monte <[email protected]>
* Update SASS division to use math.div 

Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

* add `@use 'sass:math';` in top of file
@limonte
Copy link
Member

limonte commented Jun 29, 2021

Thanks for the contribution @GeoSot!

I don't like the idea of increasing complexity and it looks out of the issue that we're trying to solve. Is it possible to stick to one scss file and avoid adding the complexity with build.scss?

@GeoSot
Copy link
Author

GeoSot commented Jun 29, 2021

To be honest, I cannot think of something else. We need a file that has the styling, and when you want to build the default css for dist, we need to import the

@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/_variables";
@import "~bootstrap/scss/mixins";

if we could do a check for defined vars and after import the above lines, it could be done. But as I searched cannot be done.
I don't find it bad idea to have a build file, that maybe only include the theme.scss.

It will give the possibility for all themes to be customized when imported in scss projects. (plus we can use the same file with bootstrap 5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bootstrap 4 Theme CSS Values alignment
9 participants