From a1b28d3a77297e0c49e1f91d4f8cfc73dbedd843 Mon Sep 17 00:00:00 2001 From: jackahl Date: Thu, 28 Dec 2023 13:01:53 +0100 Subject: [PATCH 1/4] add scss to work with volto-light-theme --- src/theme/_main.scss | 9 +++++++++ src/theme/main.less | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/theme/_main.scss diff --git a/src/theme/_main.scss b/src/theme/_main.scss new file mode 100644 index 0000000..0145b87 --- /dev/null +++ b/src/theme/_main.scss @@ -0,0 +1,9 @@ +//Specific styles for volto-light-theme +.block.logos .ui.stackable, +.block.logos .grid-items, +.block.logos h2.headline{ + @include default-container-width(); + // Adding 2 * 10px (one for each side) we force the container to extend the value of + // the gutter to match the other blocks margin. + max-width: calc(var(--default-container-width) + 2 * 10px); +} diff --git a/src/theme/main.less b/src/theme/main.less index 42ef900..f64c108 100644 --- a/src/theme/main.less +++ b/src/theme/main.less @@ -96,7 +96,7 @@ } h3 { - width: 300px; + max-width: 300px; } } @@ -118,6 +118,6 @@ } h3 { - width: 400px; + max-width: 400px; } } From 278670527f1bf6114a2514aba1325780f89b6860 Mon Sep 17 00:00:00 2001 From: jackahl Date: Thu, 28 Dec 2023 14:37:16 +0100 Subject: [PATCH 2/4] unify sizes of all Logos, disregarding number of columns --- src/theme/main.less | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/theme/main.less b/src/theme/main.less index f64c108..5c3fe38 100644 --- a/src/theme/main.less +++ b/src/theme/main.less @@ -92,7 +92,6 @@ .three.column.grid { .logo-image { max-width: 200px; - height: 200px; } h3 { @@ -100,9 +99,19 @@ } } - .two.column.grid { + .logo-block { + display: flex; + flex-direction: column; + align-items: center; + .logo-image { - height: 300px; + width: 100%; + max-height: 100px; + object-position: top center; + } + + h3 { + max-width: 400px; } } } @@ -114,6 +123,7 @@ .logo-image { width: 100%; + max-height: 100px; object-position: top center; } From 732da32ac66f4e10b784b1a26ccbbba1b12c8b78 Mon Sep 17 00:00:00 2001 From: jackahl Date: Fri, 29 Dec 2023 10:47:50 +0100 Subject: [PATCH 3/4] add changelog --- news/6.feature | 1 + src/components/Logo/View.jsx | 5 +++-- src/components/Logo/schema.js | 9 +++------ 3 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 news/6.feature diff --git a/news/6.feature b/news/6.feature new file mode 100644 index 0000000..e87a440 --- /dev/null +++ b/news/6.feature @@ -0,0 +1 @@ +Compatiblity with kitconcept volto-light-theme container widths @jackahl diff --git a/src/components/Logo/View.jsx b/src/components/Logo/View.jsx index ee258cd..3d666b9 100644 --- a/src/components/Logo/View.jsx +++ b/src/components/Logo/View.jsx @@ -44,8 +44,9 @@ const View = (props) => { /> ))} - -

{data.heading}

+ {data.heading && ( +

{data.heading}

+ )} {config.blocks.blocksConfig.logo.showDescriptionField && data.description &&

{data.description}

} diff --git a/src/components/Logo/schema.js b/src/components/Logo/schema.js index 5cb6a5d..d260a24 100644 --- a/src/components/Logo/schema.js +++ b/src/components/Logo/schema.js @@ -36,12 +36,9 @@ export const LogoBlockSchema = (props) => { { id: 'default', title: 'Default', - fields: [ - 'logo', - 'heading', - config.blocks.blocksConfig.logo.showDescriptionField && 'description', - 'link', - ], + fields: config.blocks.blocksConfig.logo.showDescriptionField + ? ['logo', 'heading', 'description', 'link'] + : ['logo', 'heading', 'link'], }, ], properties: { From b0bb9cc2c52080af012eee42039af56bcd88c1d2 Mon Sep 17 00:00:00 2001 From: jackahl Date: Fri, 29 Dec 2023 13:10:14 +0100 Subject: [PATCH 4/4] add customSyntax property for scss to stylelint in package.json --- package.json | 6 ++++++ src/theme/_main.scss | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b56e070..5822748 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,12 @@ "**/*.overrides" ], "customSyntax": "postcss-less" + }, + { + "files": [ + "**/*.scss" + ], + "customSyntax": "postcss-scss" } ], "rules": { diff --git a/src/theme/_main.scss b/src/theme/_main.scss index 0145b87..72fa2e4 100644 --- a/src/theme/_main.scss +++ b/src/theme/_main.scss @@ -1,9 +1,9 @@ //Specific styles for volto-light-theme .block.logos .ui.stackable, .block.logos .grid-items, -.block.logos h2.headline{ +.block.logos h2.headline { @include default-container-width(); - // Adding 2 * 10px (one for each side) we force the container to extend the value of - // the gutter to match the other blocks margin. + // Adding 2 * 10px (one for each side) we force the container to extend the value of + // the gutter to match the other blocks margin. max-width: calc(var(--default-container-width) + 2 * 10px); }