-
- Downloads
[REF] *: review scss variables handling
Unlike LESS, SCSS variables are not lazy loaded. Our system has thus to be updated. This commit creates new templates which are t-called in assets bundles (to replace the old less_helpers template): - web._assets_utils: regroups the mixins and functions which *can* (and so should) be available in every asset bundle - web._assets_primary_variables: regroups the variables (or mixins used as variables) which *can* (and so should) be available in every asset bundle - web._assets_secondary_variables: same as above but provides an environnement where all the 'primary' ones are accessible. This is for example useful to handle the community/enterprise split: // Community primary variables $o-pink-color: pink; // enterprise color $o-brand-primary: blue; // Enterprise primary variables $o-brand-primary: $o-pink-color; // Community secondary variables $o-my-darker-primary: darken($o-brand-primary, 5%); => If there was only one variable template, enterprise edition would have been able to define its primary color at the end but the darker primary would not have been updated. Using the "!default" system and putting enterprise definition above would not have solved the problem as the $o-pink-color would not have been accessible. - web._assets_backend_helpers: regroups the variables, mixins and functions which *can* (and so should) be available in the backend asset bundle only. This is especially (only?) useful for bootstrap variables overriddes. - web._assets_frontend_helpers: regroups the variables, mixins and functions which *can* (and so should) be available in the frontend asset bundle only. This is especially (only?) useful for bootstrap variables overriddes. Note: bootstrap variables are not accessible in any of those anymore. If you have variables that should depend on bootstrap, you have 3 solutions: - Find another way: your variable is probably useless, use bootstrap variables directly or create a variable that will influence the value of bootstrap variables. E.g. instead of declaring: `$myvar: $bootstrapvar * 3` and using $myvar alone, declare: `$myvar: 3` and use `$myvar * $bootstrapvar` where needed. - Declare a copy of the bootstrap variable and use that one. In that case, you should also force-set the real bootstrap one to be sure they match (this should be done in appropriate templates mentioned above). E.g. ``` $o-boostrapvar: 5; ... $boostrapvar: $o-bootstrapvar; ``` - Set your variable to null and set it to your bootstrap expression in the file you will need it (where bootstrap variables are accessible) without forgetting to add the !default flag to allow overriddes. ``` $myvar: null; ... $myvar: $bootstrapvar * 5 !default; ``` This commit also partly changes the variable names to follow the convention: $o-<app_id>-<name> where 'app_id' is the current's app name or a meaningful unique identifier ("theme" for all themes for example, as no multiple themes can be installed).
Showing
- addons/account/static/src/scss/account_dashboard.scss 5 additions, 5 deletionsaddons/account/static/src/scss/account_dashboard.scss
- addons/account/static/src/scss/account_journal_dashboard.scss 11 additions, 11 deletions...ns/account/static/src/scss/account_journal_dashboard.scss
- addons/account/static/src/scss/account_reconciliation.scss 10 additions, 18 deletionsaddons/account/static/src/scss/account_reconciliation.scss
- addons/account/static/src/scss/variables.scss 5 additions, 0 deletionsaddons/account/static/src/scss/variables.scss
- addons/account/views/account.xml 6 additions, 0 deletionsaddons/account/views/account.xml
- addons/calendar/static/src/scss/calendar.scss 2 additions, 2 deletionsaddons/calendar/static/src/scss/calendar.scss
- addons/event/static/src/scss/event.scss 1 addition, 1 deletionaddons/event/static/src/scss/event.scss
- addons/google_calendar/static/src/scss/google_calendar.scss 1 addition, 1 deletionaddons/google_calendar/static/src/scss/google_calendar.scss
- addons/hr_attendance/static/src/scss/hr_attendance.scss 1 addition, 1 deletionaddons/hr_attendance/static/src/scss/hr_attendance.scss
- addons/hr_org_chart/static/src/scss/hr_org_chart.scss 36 additions, 52 deletionsaddons/hr_org_chart/static/src/scss/hr_org_chart.scss
- addons/hr_org_chart/static/src/scss/variables.scss 14 additions, 0 deletionsaddons/hr_org_chart/static/src/scss/variables.scss
- addons/hr_org_chart/views/hr_templates.xml 6 additions, 0 deletionsaddons/hr_org_chart/views/hr_templates.xml
- addons/im_livechat/static/src/scss/copy_clipboard.scss 1 addition, 1 deletionaddons/im_livechat/static/src/scss/copy_clipboard.scss
- addons/im_livechat/static/src/scss/im_livechat_bootstrap.scss 1 addition, 10 deletions...ns/im_livechat/static/src/scss/im_livechat_bootstrap.scss
- addons/im_livechat/views/im_livechat_channel_templates.xml 0 additions, 1 deletionaddons/im_livechat/views/im_livechat_channel_templates.xml
- addons/lunch/static/src/scss/lunch.scss 1 addition, 1 deletionaddons/lunch/static/src/scss/lunch.scss
- addons/mail/static/src/scss/chat_window.scss 10 additions, 15 deletionsaddons/mail/static/src/scss/chat_window.scss
- addons/mail/static/src/scss/chatter.scss 4 additions, 4 deletionsaddons/mail/static/src/scss/chatter.scss
- addons/mail/static/src/scss/composer.scss 7 additions, 7 deletionsaddons/mail/static/src/scss/composer.scss
- addons/mail/static/src/scss/discuss.scss 21 additions, 24 deletionsaddons/mail/static/src/scss/discuss.scss
Loading
Please register or sign in to comment