openeuropa / oe_bootstrap_theme
OpenEuropa Bootstrap base theme.
Installs: 44 608
Dependents: 1
Suggesters: 0
Security: 0
Stars: 6
Watchers: 20
Forks: 14
Open Issues: 29
Type:drupal-theme
Requires
- php: >=8.1
- drupal/core: ^10
- drupal/ui_patterns: ^1.4
- drupal/ui_patterns_settings: ^2.0
- openeuropa/ecl-twig-loader: ^4.0
Requires (Dev)
- ext-dom: *
- composer/installers: ^1.11
- drupal/core-composer-scaffold: ^10
- drupal/core-dev: ^10
- drupal/styleguide: ^2
- drush/drush: ^12
- nikic/php-parser: ^4
- openeuropa/code-review: ^2.0.0-alpha6
- openeuropa/task-runner-drupal-project-symlink: ^1.0-beta6
- phpspec/prophecy-phpunit: ^2
- 1.x-dev
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.0
- 1.10.x-dev
- 1.10.1
- 1.10.0
- 1.9.1
- 1.9.0
- 1.8.1
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
- 1.0.0-beta7
- 1.0.0-beta6
- 1.0.0-beta5
- 1.0.0-beta4
- 1.0.0-beta3
- 1.0.0-beta2
- 1.0.0-beta1
- 1.0.0-alpha8
- 1.0.0-alpha7
- 1.0.0-alpha6
- 1.0.0-alpha5
- 1.0.0-alpha4
- 1.0.0-alpha3
- 1.0.0-alpha2
- 1.0.0-alpha1
- 0.1307202203181215
- 0.1047202201181653
- 0.1047202201181650
- 0.291020212338
- 0.291020211453
- 0.281020211203
- 0.261020211605
- 0.211020211256
- 0.210920211501
- 0.181120211115
- 0.181020211745
- 0.161120211205
- 0.150920212034
- 0.150920211101
- 0.140920211750
- 0.100920211846
- 0.080920211706
- 0.070920212153
- 0.060920211739
- 0.031120211510
- 0.021120211318
- 0.17092021819
- 0.011020211805
- 0.011020211309
- 0.3425.202411211230
- 0.3425.202411211130
- 0.3423.202410101400
- 0.3421.011120241130
- 0.3417.202411041100
- 0.3415.202410171445
- 0.3414.202410161330
- 0.3414.202410101410
- 0.3413.202409301255
- 0.3325.202409051640
- 0.3325.202409051430
- 0.3066.202407161230
- 0.3066.202407161155
- 0.3066.202407151755
- 0.3066.202407121545
- 0.3018.202408230101
- 0.2975.202411041300
- 0.2082.202211071931
- 0.2082.202210241647
- 0.2002.202210070921
- 0.2002.202209281824
- 0.2002.202209141101
- 0.2002.202209121903
- 0.1995.202301231608
- 0.1995.202301230844
- 0.1995.202210011046
- 0.1915.202301031227
- 0.1910.202209271003
- 0.1906.202208011636
- 0.1900.202208121930
- 0.1823.202207081315
- 0.1618.202206100945
- 0.1618.202206071320
- 0.1618.202206011600
- 0.1618.202205191818
- 0.1452.202204201715
- 0.1425.202204071325
- 0.1418.202205311215
- 0.1416.202204221635
- 0.1416.202204150010
- 0.1317.202203291220
- 0.1317.202203241635
- 0.1307.202203281705
- 0.1307.202203181216
- 0.1307.202203161735
- 0.1307.202203160945
- 0.1307.202203100940
- 0.1280.202203170900
- 0.1280.202203161840
- 0.1280.202203151730
- 0.1280.202203151700
- 0.1280.202203151300
- 0.1280.202203141000
- 0.1255.202203291523
- 0.1255.202203291304
- 0.1255.202203171757
- 0.1190.202202281750
- 0.1175.202202281815
- 0.1159.202204051310
- 0.1159.202204051300
- 0.1047.202202071100
- 0.836.202202011734
- 0.823.202201111234
- 0.779.202202030945
- 0.779.202202030940
- 0.779.202202021710
- 0.779.202202021630
- 0.779.202202020929
- 0.750.202111261805
- 0.318.202407271117
- 0.318.202407271045
- 0.318.202406121551
- 0.318.202406072027
- 0.71.0
- 0.1.202411051530
- 0.1.202408051724
- 0.1.202302231740
- 0.1.202301130938
- 0.1.202211090950
- 0.1.202210121625
- 0.1.202209291409
- 0.1.202209091141
- 0.1.202209022238
- 0.1.202208041835
- 0.1.202206231430
- 0.1.202206071025
- 0.1.202204221756
- 0.1.202204221659
- 0.1.202204061107
- 0.1.202203290731
- 0.1.202203080945
- 0.1.202203021520
- 0.1.202203021223
- 0.1.202202231930
- 0.1.202202231820
- 0.1.202202231550
- 0.1.202202221800
- 0.1.202202081115
- 0.1.202202072010
- 0.1.202202031130
- dev-OEL-3425
- dev-OEL-3354
- dev-OEL-2975
- dev-release-1.17.0
- dev-OEL-3421
- dev-OEL-3402
- dev-OEL-3406
- dev-OEL-3414
- dev-OEL-3415
- dev-OEL-3423
- dev-OEL-2742
- dev-OEL-3343
- dev-EPIC/OEL-3442
- dev-OEL-3382
- dev-OEL-3325
- dev-OEL-2283
- dev-OEL-3020
- dev-OEL-3024
- dev-contribution/EPHEH-318
- dev-update-1.x
- dev-OEL-3120
- dev-OEL-3066
- dev-OEL-2799
- dev-UCPKN-2248
- dev-OEL-2325
- dev-OEL-2261
- dev-OEL-2252
- dev-d10
- dev-OEL-1900
- dev-OEL-1442
- dev-OEL-1452
- dev-OEL-1380
- dev-OEL-1160
- dev-OEL-1227
- dev-OEL-755-backup
- dev-OEL-1189
- dev-OEL-1026
- dev-OEL-1130
- dev-OEL-1047
- dev-OEL-1092-user-listing-display-mode
- dev-OEL-779-whitelabel-fixes-navigation
- dev-FRONT-2491
- dev-OEL-824
- dev-OEL-490
- dev-OEL-751
- dev-OEL-752
- dev-OEL-763
- dev-OEL-757
- dev-OEL-750
- dev-OEL-720
- dev-OEL-723
- dev-OEL-722
- dev-OEL-711
- dev-OEL-717
- dev-OEL-716
- dev-php-7.1
- dev-FRONT-2488
- dev-OEL-488
- dev-OEL-478-POC
- dev-FRONT-3061
- dev-OEL-408
- dev-ISSUE-63
- dev-FRONT-patterns-alexis
- dev-EWPP-0000
- dev-preserve-link-attributes
- dev-FRONT-patterns-theo
- dev-FRONT-patterns-paulo
- dev-FRONT-patterns-tiberiu
- dev-alexis
- dev-test-old-pipeline
- dev-ISAICP-6551
- dev-master
- dev-bs-beta3
- dev-temp/srb
- dev-D8TSRB-814
- dev-srb-beta3
- dev-D8TSRB-783
- dev-fix/menu
- dev-D8AGE-64
- dev-stub-D8AGE-64-finder-iterator-pass
- dev-temp/efsa
- dev-temp/D8TEFSA-126
- dev-temp/D8TEFSA-400
- dev-temp/efsa_fix_badge
- dev-bugfix/D8AGE-92
- dev-bugfix/D8AGE-95
- dev-bugfix/D8AGE-91
- dev-feature/D8AGE-93
- dev-bugfix/D8AGE-90
- dev-D8AGE-89
- dev-D8AGE-88
- dev-D8AGE-87
- dev-D8AGE-84
- dev-D8AGE-77
- dev-D8AGE-51
- dev-D8AGE-83
- dev-D8AGE-82
- dev-D8AGE-78
- dev-D8AGE-70
- dev-D8AGE-79
- dev-D8AGE-74
- dev-D8AGE-72
- dev-D8AGE-75
- dev-D8AGE-24
This package is auto-updated.
Last update: 2024-11-21 10:29:39 UTC
README
Drupal 8/9 theme based on Bootstrap 5, UI Patterns and the OpenEuropa Bootstrap Component Library.
Usage as a dependency
Requirements
The package is meant for Drupal projects that manage their Drupal dependencies via Composer.
The usage of Docker in the dependent project is suggested, but not required.
Check the composer.json for required PHP version and other dependencies.
Add the composer package
Add this manually in composer.json, or combine with existing entries:
"extra": {
"artifacts": {
"openeuropa/oe_bootstrap_theme": {
"dist": {
"url": "https://github.com/{name}/releases/download/{pretty-version}/{project-name}-{pretty-version}.zip",
"type": "zip"
}
}
}
}
Require with composer:
composer require openeuropa/oe_bootstrap_theme:^1.0@alpha
Review the installation
Review the installed version with composer info | grep oe_
.
Review the installation directory with composer info openeuropa/oe_bootstrap_theme | grep path
. Depending on your setup, this could be build/themes/contrib/oe_bootstrap_theme
.
If installation was successful, the instance of oe_bootstrap_theme
should contain a number of subdirectories within /assets/
, including /assets/bcl/
.
Enable and configure
Enable the required helper module:
./vendor/bin/drush en oe_bootstrap_theme_helper
Enable the theme itself and set it as default:
./vendor/bin/drush config-set system.theme default oe_bootstrap_theme
Generate a sub-theme
The package provides a task-runner command to generate a sub-theme.
# Install the task runner: composer require openeuropa/task-runner # Learn more about the create-subtheme command: ./vendor/bin/run help oe_bootstrap_theme:create-subtheme # Generate a sub-theme ./vendor/bin/run oe_bootstrap_theme:create-subtheme [...]
After using the command, first commit the generated sub-theme in git, then review all of it, and determine which parts you can remove or you have to alter.
An older, manual way to create a sub-theme is described in kits/README.md.
Backward compatibility layer
This component follows semantic versioning as per OpenEuropa initiative.
The theme provides an API to its sub-themes, which consists of PHP classes and methods, Twig templates, JavaScript, and CSS/SASS, which can all be altered or overridden by the sub-theme.
Bug fixes and improvements that break backward compatibility on the theme layer (Twig, JS, CSS) are shipped in minor versions.
Backward compatibility is assured by dedicated "Backward compatibility settings", configurable in the theme settings page.
These settings allow to restore the previous backward compatible behaviour.
When upgrading the theme in an existing installation, new backward compatibility settings will be automatically enabled. They can be disabled when a developer updates the sub-theme code.
For new installations, all the backward compatibility settings are disabled.
This approach eases the adoption of changes or improvements that would be otherwise tied to a new major. It allows developers to contribute changes to the current major and selectively enable them without having to update the theme completely to a new major release.
"Version 2.x" patterns
For version 2.x of this theme, we want to reduce the number of preprocess needed to use the patterns, and instead be able to use formatters and view modes
directly as much as possible.
We started to ship in version 1.x patterns that already embrace this new approach. They have been tagged with category "Version 2.x".
We will do the best to avoid any breaking changes to these patterns during the 1.x lifecycle. But it might be that some changes will be still
needed. We will communicate such changes together with the release.
Development setup
Using LAMP stack or similar
This is not officially supported. You are on your own.
Using Docker Compose
Alternatively, you can build a development site using Docker and Docker Compose with the provided configuration.
Docker provides the necessary services and tools such as a web server and a database server to get the site running, regardless of your local host configuration.
Requirements
Override docker settings
The package provides default settings for Docker Compose in docker-compose.yml
. Most of the time these are sufficient.
An optional docker-compose.override.yml
file can be created to selectively override specific values, or to define entirely new services.
For services that are defined in both files, Docker Compose applies merge rules that are documented in the official Docker Compose documentation.
Start the container
If you have other (daemonized) containers running, you might want to stop them first:
docker stop $(docker ps -q)
To start, run:
docker-compose up
It's advised to not daemonize docker-compose
so you can turn it off (CTRL+C
) quickly when you're done working.
However, if you'd like to daemonize it, you have to add the flag -d
:
docker-compose up -d
Optionally purge existing installation
If you already had the package installed, and want a clean start:
docker-compose exec web rm composer.lock docker-compose exec web rm -rf vendor/ docker-compose exec web rm -rf build/
Install and build
Install dependencies, build artifacts, and install Drupal.
docker-compose exec -u node node npm install docker-compose exec -u node node npm run build docker-compose exec web composer install docker-compose exec web ./vendor/bin/run drupal:site-install
Visit the development site
Using default configuration, the development site files should be available in the build
directory and the development site should be available at: http://127.0.0.1:8080/build or http://web:8080/build.
Run the tests
Run the grumphp checks:
docker-compose exec web ./vendor/bin/grumphp run
Run the phpunit tests:
docker-compose exec web ./vendor/bin/phpunit
Patch BCL components
BCL components can be patched by using the patch-package
NPM project.
To patch a component:
- Modify its source files directly in
./node_modules/@openeuropa/bcl-theme-default
- Run:
docker-compose exec -u node node git config --global user.email "name@example.com" docker-compose exec -u node node git config --global user.name "Name" docker-compose exec -u node node npx patch-package @openeuropa/bcl-theme-default --patch-dir=patches/npm
Patches will be generated in ./patches/npm
and applied when running npm install
.
Note: generate patches only inside the docker container to use the same version of npm/npx.
Contribute
Please read the full documentation for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the available versions, see the tags on this repository.
Upgrade from older versions
Upgrade to 1.0.0-beta2
Dependencies to the following packages have been removed in composer.json:
- drupal/description_list_field
- openeuropa/oe_content
- openeuropa/oe_media
- openeuropa/oe_paragraphs
Be sure to require the component if you need any of them.
Upgrade to 1.0.0-alpha8
Paragraphs migration
Paragraphs-related theming and functionality has been moved from the OpenEuropa Bootstrap base theme to OpenEuropa Whitelabel.
If you are using openeuropa/oe_whitelabel
, and you want paragraphs functionality, you should upgrade it to 1.0.0-alpha6
or higher, and refer to the upgrade instructions found there.