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

Upgrade and adapt the theme tovolto-slider-block 6.0.0 add-on #288

Merged
merged 11 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RESET=`tput sgr0`
YELLOW=`tput setaf 3`

PLONE_VERSION=6.0.8
VOLTO_VERSION=17.5.0
VOLTO_VERSION=17.7.0

ADDON_NAME='@kitconcept/volto-light-theme'
ADDON_PATH='volto-light-theme'
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,15 @@ It is recommended that your project or policy add-on `package.json` include the

```json
"dependencies": {
"@eeacms/volto-accordion-block": "9.0.0",
"@kitconcept/volto-button-block": "2.1.0",
"@kitconcept/volto-dsgvo-banner": "1.3.0",
"@kitconcept/volto-heading-block": "2.2.0",
"@kitconcept/volto-introduction-block": "1.0.0",
"@kitconcept/volto-light-theme": "1.0.0",
"@kitconcept/volto-separator-block": "4.0.0",
"@kitconcept/volto-highlight-block": "3.0.0",
"@eeacms/volto-accordion-block": "^10.4.0",
"@kitconcept/volto-button-block": "^2.3.1",
"@kitconcept/volto-dsgvo-banner": "^1.3.0",
"@kitconcept/volto-heading-block": "^2.4.0",
"@kitconcept/volto-highlight-block": "^3.0.0",
"@kitconcept/volto-introduction-block": "^1.0.0",
"@kitconcept/volto-separator-block": "^4.0.0",
"@kitconcept/volto-slider-block": "^6.0.0",
"@kitconcept/volto-light-theme": "^2.0.0",
}
```

Expand Down
22 changes: 22 additions & 0 deletions news/288.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Upgraded the dependency on `@kitconcept/volto-slider-block` to use `6.0.0`.

This is a drop-in replacement, so no action is required for the existing slider blocks you may have already in your sites.
However, the CSS classes of the structural slider block elements changed in this version.
The inner (visible objects) CSS classes remain unchanged.
If you have customized them in your project, you may have to update them, although the structural class names are rarely customized aside from vertical spacing properties.
They are mapped 1:1 with the previous ones, following this table correspondence:

| Old className | New className |
| --------------- | ---------------- |
| slick-slider | slider-wrapper |
| slick-list | slider-viewport |
| slick-track | slider-container |
| slick-slide | slider-slide |
| slick-arrow | slider-button |
| slick-prev | slider-button-prev |
| slick-next | slider-slide-next |
| slick-next | slider-slide-next |
| slick-dots | slider-dots |
| slick-dot | slider-dot |

For more information, please check the https://github.com/kitconcept/volto-slider-block/blob/main/README.md
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@kitconcept/volto-highlight-block": "^3.0.0",
"@kitconcept/volto-introduction-block": "^1.0.0",
"@kitconcept/volto-separator-block": "^4.0.0",
"@kitconcept/volto-slider-block": "5.1.1",
"@plone/volto": "^17.5.0"
"@kitconcept/volto-slider-block": "^6.0.0",
"@plone/volto": "^17.6.1"
}
}
13 changes: 13 additions & 0 deletions src/theme/_bgcolor-blocks-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@
}
}

// Slider
#page-document .blocks-group-wrapper.grey:has(.block.slider:first-child) {
padding-top: 0;
padding-bottom: 0px; // Adjust for the padding from the slider itself
}

#page-document .blocks-group-wrapper.grey .block.slider,
.block-editor-slider.has--backgroundColor--grey {
.slider-dot:not(.slider-dot--selected)::after {
background: #fff;
}
}

// Edit mode adjustments
.block-editor-gridBlock.has--backgroundColor--grey .block h2.headline {
padding-top: $spacing-xlarge;
Expand Down
87 changes: 16 additions & 71 deletions src/theme/blocks/_slider.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
// Slider Block
:root {
--slider-block-edit-width-adjustment: 40px;
}

$sliderImagesAspectRatio: var(--slider-images-aspect-ratio, 16/9);

.block.slider {
Expand All @@ -11,84 +7,33 @@ $sliderImagesAspectRatio: var(--slider-images-aspect-ratio, 16/9);
padding-bottom: 0;
}

.highlight-image-wrapper img {
// Override Volto's Image Component inline style aspect ratio.
aspect-ratio: $sliderImagesAspectRatio !important;
.slider-viewport {
margin-bottom: 0;
}

.teaser-item,
.grid-teaser-item {
flex-direction: column;
}
.teaser-item {
padding-bottom: $spacing-xlarge;
.slider-dots {
padding-bottom: 40px;
sneridagh marked this conversation as resolved.
Show resolved Hide resolved
}

.slide-wrapper:not(.empty-slide) {
padding-bottom: $spacing-xlarge;
}
.highlight-image-wrapper {
display: flex; // Small gap was appearing between the wrapper and the image (??)

.slick-arrow {
width: 50px;
// Equal to the space we give at the bottom to place the buttons
height: calc(100% - $spacing-xlarge);
background-color: rgba(0, 0, 0, 0.15);
color: $white;
// border: 2px solid red;
opacity: 0;
transition: opacity 0.2s ease-in;
&:hover {
opacity: 1;
img {
// Override Volto's Image Component inline style aspect ratio.
aspect-ratio: $sliderImagesAspectRatio !important;
}
}

.slick-next,
.slick-prev {
top: initial;
}

.slick-next {
right: 0;
// Equal to the space we give at the bottom to place the buttons
bottom: $spacing-xlarge;
@media only screen and (max-width: $computer-width) {
display: none !important;
}
.teaser-item,
.grid-teaser-item {
flex-direction: column;
}

.slick-prev {
z-index: 9;
left: 0;
@media only screen and (max-width: $computer-width) {
display: none !important;
}
.teaser-item {
padding-bottom: $spacing-medium;
}

.slick-dots {
bottom: 34px;
line-height: 0;

li,
button {
width: 46px;
height: 6px;
padding: 0;
background-color: $secondary-grey;
}

li.slick-active button {
background-color: $black;
}

li {
margin-right: 13px;
margin-left: 0;
}

button:before {
display: none;
content: '';
}
.slide-wrapper:not(.empty-slide) {
padding-bottom: $spacing-xlarge;
}

.teaser-item.top {
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1851,8 +1851,8 @@ __metadata:
"@kitconcept/volto-highlight-block": ^3.0.0
"@kitconcept/volto-introduction-block": ^1.0.0
"@kitconcept/volto-separator-block": ^4.0.0
"@kitconcept/volto-slider-block": 5.1.1
"@plone/volto": ^17.5.0
"@kitconcept/volto-slider-block": ^6.0.0
"@plone/volto": ^17.6.1
languageName: unknown
linkType: soft

Expand Down