Skip to content

Commit

Permalink
Refs #129216 added variable support to styles.less:
Browse files Browse the repository at this point in the history
- define styledPadding variable to add some padding when we have background set
  • Loading branch information
ichim-david committed Mar 26, 2021
1 parent 38721c6 commit c5dae21
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/StyleWrapper/StyleWrapperView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const StyleWrapperView = (props) => {
className: cx(style?.cssClass, customClass, align, {
align,
styled,
'styled-with-bg': styleData.backgroundColor,
'screen-height': isScreenHeight,
'full-width': align === 'full',
large: size === 'l',
Expand Down
20 changes: 19 additions & 1 deletion src/styles.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
@type: 'extra';
@element: 'custom';

@import (multiple, reference) '../../theme.config';
@import (multiple, reference, optional) '../../theme.config';

@addon: 'volto-addons';
@addontype: 'blockstyle';
@addonelement: 'styles';
@styledPadding: 1rem;

/* Helper to load variables */
.loadAddonVariables() {
@import (optional) '@{addonelement}.variables';
@import (optional)
'@{siteFolder}/../addons/@{addon}/@{addontype}s/@{addonelement}.variables';
}


.loadAddonVariables();

.open-styles-button {
width: 100%;
Expand Down Expand Up @@ -81,6 +96,9 @@
background-size: cover;
}
}
.styled-with-bg {
padding: @styledPadding;
}

// Fix overrides
#view .block:before {
Expand Down

0 comments on commit c5dae21

Please sign in to comment.