@kitconcept/volto-light-theme 1.0.0-rc.1 → 1.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,14 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 1.0.0-rc.2 (2023-07-07)
12
+
13
+ ### Bugfix
14
+
15
+ - Add NewsItemView @iFlamieng [#127](https://github.com/kitconcept/volto-light-theme/pull/127)
16
+ - Add support for margins in responsive. Improve the spacing in grids. @sneridagh [#129](https://github.com/kitconcept/volto-light-theme/pull/129)
17
+
18
+
11
19
  ## 1.0.0-rc.1 (2023-07-05)
12
20
 
13
21
  ### Bugfix
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitconcept/volto-light-theme",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0-rc.2",
4
4
  "description": "Volto Light Theme by kitconcept",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -0,0 +1,57 @@
1
+ /**
2
+ * OVERRIDE NewsItemView.jsx
3
+ * REASON: BFS theme
4
+ * DATE: 2023-07-04
5
+ * DEVELOPER: @IFlameing
6
+ */
7
+
8
+ /**
9
+ * NewsItemView view component.
10
+ * @module components/theme/View/NewsItemView
11
+ */
12
+
13
+ import React from 'react';
14
+ import PropTypes from 'prop-types';
15
+ import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
16
+ import { FormattedDate } from '@plone/volto/components';
17
+
18
+ /**
19
+ * NewsItemView view component class.
20
+ * @function NewsItemView
21
+ * @params {object} content Content object.
22
+ * @returns {string} Markup of the component.
23
+ */
24
+ const NewsItemView = ({ content }) => {
25
+ return (
26
+ <div id="page-document" className="ui container viewwrapper event-view">
27
+ <div className="dates">
28
+ {content?.effective ? (
29
+ <span className="day">
30
+ <FormattedDate date={content?.effective} />{' '}
31
+ </span>
32
+ ) : (
33
+ <span className="day">No date</span>
34
+ )}{' '}
35
+ <span className="headtitle">| {content?.head_title}</span>
36
+ </div>
37
+ <RenderBlocks content={content} />
38
+ </div>
39
+ );
40
+ };
41
+
42
+ /**
43
+ * Property types.
44
+ * @property {Object} propTypes Property types.
45
+ * @static
46
+ */
47
+ NewsItemView.propTypes = {
48
+ content: PropTypes.shape({
49
+ title: PropTypes.string,
50
+ description: PropTypes.string,
51
+ text: PropTypes.shape({
52
+ data: PropTypes.string,
53
+ }),
54
+ }).isRequired,
55
+ };
56
+
57
+ export default NewsItemView;
@@ -31,7 +31,9 @@
31
31
  margin-bottom: $grid-block-vertical-spacing-bottom;
32
32
  }
33
33
  &.next--is--same--block-type.next--has--same--backgroundColor {
34
- margin-bottom: -1rem;
34
+ // We rely on the grid gutter to keep the vertical spacing in case grid + grid
35
+ // So here we cancel the default block margin-bottom
36
+ margin-bottom: 0;
35
37
  }
36
38
  }
37
39
 
@@ -5,3 +5,28 @@
5
5
  padding: 0;
6
6
  margin-top: 0;
7
7
  }
8
+
9
+ .contenttype-news-item {
10
+ .documentFirstHeading {
11
+ margin-top: 0px;
12
+ }
13
+ .blocks-group-wrapper {
14
+ padding-top: 0px;
15
+ }
16
+ .dates {
17
+ max-width: var(--default-container-width) !important;
18
+ margin-top: 40px;
19
+ margin-right: auto;
20
+ margin-bottom: 40px;
21
+ margin-left: auto;
22
+ .day,
23
+ .headtitle {
24
+ font-size: 18px;
25
+
26
+ font-weight: 700;
27
+ letter-spacing: 1px;
28
+ line-height: 24px;
29
+ text-transform: uppercase;
30
+ }
31
+ }
32
+ }
@@ -4,12 +4,12 @@
4
4
  --narrow-container-width: 620px;
5
5
  }
6
6
 
7
- // Container queries still do not work with CSS properties
7
+ // Container queries still do not work with CSS custom properties
8
8
  // They should be exact numbers
9
9
  // For now, maintain in sync with the above
10
- $layout-container-width: 1440px;
11
- $default-container-width: 940px;
12
- $narrow-container-width: 620px;
10
+ $layout-container-width: 1440px !default;
11
+ $default-container-width: 940px !default;
12
+ $narrow-container-width: 620px !default;
13
13
 
14
14
  @mixin narrow-container-width() {
15
15
  max-width: var(--narrow-container-width);
@@ -21,6 +21,13 @@ $narrow-container-width: 620px;
21
21
  max-width: var(--default-container-width);
22
22
  margin-right: auto;
23
23
  margin-left: auto;
24
+
25
+ // This is mostly aesthetical if you don't want to "see" the jump
26
+ // but a nice animation instead - PoC (WIP)
27
+ // @media only screen and (max-width: #{$default-container-width + 5px}) {
28
+ // margin-right: 5px;
29
+ // margin-left: 5px;
30
+ // }
24
31
  }
25
32
 
26
33
  @mixin layout-container-width() {
@@ -29,11 +36,24 @@ $narrow-container-width: 620px;
29
36
  margin-left: auto;
30
37
  }
31
38
 
32
- // One still cannot use variables or CSS properties directly on @container queries
39
+ // One still cannot use CSS custom properties directly on @container queries
33
40
  @mixin adjustMarginsToContainer($width) {
41
+ // Next two ones are mostly aesthetical if you don't want to "see" the jump - PoC (WIP)
42
+ // transition: margin 1s ease;
43
+
44
+ // @container (max-width: #{$width + 5px}) {
45
+ // margin-right: 5px;
46
+ // margin-left: 5px;
47
+ // }
48
+
49
+ // @container (max-width: #{$width}) {
50
+ // margin-right: 0px;
51
+ // margin-left: 0px;
52
+ // }
53
+
34
54
  @container (max-width: #{$width - 1}) {
35
- margin-right: 2rem;
36
- margin-left: 2rem;
55
+ margin-right: 20px;
56
+ margin-left: 20px;
37
57
  }
38
58
  }
39
59
 
@@ -127,7 +147,9 @@ footer {
127
147
  & > pre,
128
148
  & > .block.code {
129
149
  @include narrow-container-width();
130
- @include adjustMarginsToContainer($narrow-container-width + 2 * 36px);
150
+ // Why was this for? Removing for now (Victor: 2023-07-06)
151
+ // @include adjustMarginsToContainer($narrow-container-width + 2 * 36px);
152
+ @include adjustMarginsToContainer($narrow-container-width);
131
153
  }
132
154
 
133
155
  & > h1.documentFirstHeading,
@@ -146,6 +168,7 @@ footer {
146
168
  & > .table-of-contents,
147
169
  & > .slate blockquote {
148
170
  @include default-container-width();
171
+ @include adjustMarginsToContainer($default-container-width);
149
172
  }
150
173
 
151
174
  & > .block.teaser,
@@ -234,7 +257,18 @@ footer {
234
257
  .block.gridBlock .grid-items,
235
258
  .block.gridBlock h2.headline {
236
259
  @include default-container-width();
237
- max-width: calc(var(--default-container-width) + 1rem);
260
+ // Adding 2 * 20px (one for each side) we force the container to extend the value of
261
+ // the gutter
262
+ max-width: calc(var(--default-container-width) + 2 * 20px);
263
+ }
264
+
265
+ .block.gridBlock {
266
+ .ui.grid > .column:not(.row):first-child {
267
+ padding-left: 20px;
268
+ }
269
+ .ui.grid > .column:not(.row):last-child {
270
+ padding-right: 20px;
271
+ }
238
272
  }
239
273
 
240
274
  // Fix for Image Grid with only one image
@@ -252,6 +286,11 @@ body.has-toolbar.has-sidebar .block .ui.basic.button.delete-button {
252
286
  margin-right: -30px !important;
253
287
  }
254
288
 
289
+ // Listings edge case, conflicting with Pastanaga CSS
290
+ .listing-item {
291
+ width: initial;
292
+ }
293
+
255
294
  #page-add,
256
295
  #page-edit {
257
296
  .block-editor-accordion {
@@ -1,2 +1,7 @@
1
1
  // We want the separation between cells in grids to be 1rem only
2
- @gutterWidth: 1rem;
2
+ @gutterWidth: 20px;
3
+ @rowSpacing: 20px;
4
+
5
+ // This has to be 2 * 20px because it's going to be 1/2 in the source.
6
+ @stackableGutter: 2 * 20px;
7
+