-
Notifications
You must be signed in to change notification settings - Fork 13
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
FRONT-2362: Refactor theme and sub-theme to use bcl-builder. #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disclaimer: I haven't double checked all the paths
Many thanks for the review and updates @drishu I updated the PR accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on the whitelabel I noticed one missed point about the disabling of the system style sheets
Thanks for the review, PR updated accordingly. |
…e bootstrap-ie11 to 5.0.1.
…to .libraries.yml.
Co-authored-by: Szilagyi Andras <aszilagyi@live.com>
kits/default/default.info.hidden.yml
Outdated
base theme: oe_bootstrap_theme | ||
base theme: OE_BOOTSTRAP_THEME_SUBTHEME_MACHINE_NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to stay oe_bootstrap_theme as it's the base theme.
kits/default/default.info.hidden.yml
Outdated
oe_bootstrap_theme/bcl: false | ||
oe_bootstrap_theme/bcl: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we remove the bcl from the original theme? We can keep the original coming from oe_bootstrap_theme, we don't even have to include it in the builder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to keep the default bcl theme, as for most projects this will just be replaced by another project-specific bcl theme. My intention was thus to keep the config of the builder and to just replace the package .. in order to facilitate the setup for the future projects. but I agree it's confusing! it will undoubtedly be necessary to improve the documentation in a second step..
kits/default/default.libraries.yml
Outdated
bcl: | ||
js: | ||
assets/js/oe-bcl-default.bundle.min.js: {} | ||
css: | ||
theme: | ||
assets/css/oe-bcl-default.min.css: {} | ||
|
||
custom_style: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As written above, we can revert this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned above, ok to remove the config from the theme by default ..
kits/default/package.json
Outdated
"@openeuropa/bcl-builder": "0.4.0", | ||
"@openeuropa/bcl-theme-default": "0.4.0", | ||
"bootstrap-ie11": "5.0.2", | ||
"chokidar-cli": "1.2.0", | ||
"copyfiles": "2.4.1", | ||
"cross-env": "7.0.3", | ||
"glob": "7.1.7", | ||
"npm-run-all": "4.1.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, keep only the ones needed to compile the theme specific styles.
kits/default/bcl-builder.config.js
Outdated
copy: [ | ||
{ | ||
from: ["node_modules/@openeuropa/bcl-theme-default/css/**"], | ||
to: path.resolve(outputFolder, "assets/css"), | ||
options: { up: true }, | ||
}, | ||
{ | ||
from: ["node_modules/@openeuropa/bcl-theme-default/js/**"], | ||
to: path.resolve(outputFolder, "assets/js"), | ||
options: { up: true }, | ||
}, | ||
{ | ||
from: ["node_modules/@openeuropa/bcl-theme-default/icons/bootstrap-icons.svg"], | ||
to: path.resolve(outputFolder, "assets/icons"), | ||
options: { up: true }, | ||
}, | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This we can drop.
@@ -7,6 +7,7 @@ | |||
"prefer-stable": true, | |||
"require": { | |||
"php": ">=7.3", | |||
"drupal/components": "^2.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually don't need this module. Since we are placing the bcl files under the /template/bcl folder, you can access them by doing @oe_bootstrap_theme/bcl
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drupal/components module is needed as @oe-bcl
namespace is used within the components, see for ex: https://github.com/openeuropa/bootstrap-component-library/blob/0eba27415245ae083fb9572417f1911960aa98e4/src/components/bcl-accordion/accordion.html.twig#L48
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, my bad! I didn't see that, and forgot about oe_theme 😄 I'll create a custom twig loader for this project to expose this namespace. Enabling the whole component module to have just its loader is too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the components module handles only namespaces, so it's the correct fit for this. 2x my bad 😄
I'll restore the module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the commit that was dropping the components module.
. '<script src="https://cdn.jsdelivr.net/gh/nuxodin/ie11CustomProperties@4.1.0/ie11CustomProperties.min.js"></script>' | ||
. '<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js"></script>' | ||
. '<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>' | ||
. '<script>!function () { var e, t; ((e = document.createEvent("CustomEvent")).initEvent("Bootstrap", !0, !0), e.preventDefault(), e.defaultPrevented) || (t = Event.prototype.preventDefault, Event.prototype.preventDefault = function () { this.cancelable && (t.call(this), Object.defineProperty(this, "defaultPrevented", { get: function () { return !0 }, configurable: !0 })) }) }();</script>'; | ||
. '<script src="https://cdn.jsdelivr.net/combine/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js,npm/ie11-custom-properties@4,npm/element-qsa-scope@1"></script>' | ||
. '<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=default%2CNumber.parseInt%2CNumber.parseFloat%2CArray.prototype.find%2CArray.prototype.includes"></script>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will rework this in a next iteration.
kits/default/package.json
Outdated
"@openeuropa/bcl-builder": "0.4.0", | ||
"chokidar-cli": "1.2.0", | ||
"copyfiles": "2.4.1", | ||
"cross-env": "7.0.3", | ||
"glob": "7.1.7", | ||
"npm-run-all": "4.1.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need also to look at these dependencies, move to chokidar 3.x (I tried locally and it seemed to work), and not lock dependencies to a specific patch if not needed.
Jira issue(s):
PR goals: