@kitconcept/volto-light-theme 1.0.0-rc.6 → 1.0.0-rc.7

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,16 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 1.0.0-rc.7 (2023-07-13)
12
+
13
+ ### Bugfix
14
+
15
+ - Fix File content type @iRohitSingh [#17](https://github.com/kitconcept/volto-light-theme/pull/17)
16
+ - Add idiomatic order CSS package @sneridagh
17
+ Fix margin in edit mode for all blocks @sneridagh [#142](https://github.com/kitconcept/volto-light-theme/pull/142)
18
+ - Fix CSS for Accordion block. @danalvrz [#143](https://github.com/kitconcept/volto-light-theme/pull/143)
19
+
20
+
11
21
  ## 1.0.0-rc.6 (2023-07-12)
12
22
 
13
23
  ### Bugfix
@@ -14,7 +14,10 @@ services:
14
14
  - ${CURRENT_DIR}:/app/src/addons/${ADDON_PATH}/
15
15
  environment:
16
16
  RAZZLE_INTERNAL_API_PATH: http://backend:8080/Plone
17
- RAZZLE_API_PATH: http://localhost:8080/Plone
17
+ # In case that you want to connect to and outside (non-docker) local instance
18
+ # coment the above, use the next line
19
+ # RAZZLE_INTERNAL_API_PATH: http://host.docker.internal:8080/Plone
20
+ RAZZLE_API_PATH: http://127.0.0.1:8080/Plone
18
21
  HOST: 0.0.0.0
19
22
  ports:
20
23
  - 3000:3000
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitconcept/volto-light-theme",
3
- "version": "1.0.0-rc.6",
3
+ "version": "1.0.0-rc.7",
4
4
  "description": "Volto Light Theme by kitconcept",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -37,6 +37,7 @@
37
37
  "prettier": "2.0.5",
38
38
  "razzle-plugin-scss": "4.2.18",
39
39
  "release-it": "^16.1.0",
40
+ "stylelint-config-idiomatic-order": "8.1.0",
40
41
  "stylelint-config-prettier": "9.0.4",
41
42
  "stylelint-config-sass-guidelines": "9.0.1",
42
43
  "stylelint-prettier": "1.1.2"
@@ -0,0 +1,132 @@
1
+ /**
2
+ * OVERRIDE FileView.jsx
3
+ * REASON: BFS theme
4
+ * DATE: 2023-07-11
5
+ * DEVELOPER: @iRohitSingh
6
+ */
7
+
8
+ /**
9
+ * File view component.
10
+ * @module components/theme/View/FileView
11
+ */
12
+
13
+ import React from 'react';
14
+ import PropTypes from 'prop-types';
15
+ import { Container } from 'semantic-ui-react';
16
+
17
+ import { flattenToAppURL } from '@plone/volto/helpers';
18
+
19
+ /**
20
+ * File view component class.
21
+ * @function FileView
22
+ * @params {object} content Content object.
23
+ * @returns {string} Markup of the component.
24
+ */
25
+ const FileView = ({ content }) => (
26
+ <Container className="view-wrapper">
27
+ <h1 className="documentFirstHeading">
28
+ {content.title}
29
+ {content.subtitle && ` - ${content.subtitle}`}
30
+ </h1>
31
+ <div className="file-detail">
32
+ {content.description && (
33
+ <p className="documentDescription">{content.description}iRohitSingh</p>
34
+ )}
35
+ {content.file?.download && (
36
+ <>
37
+ <a href={flattenToAppURL(content.file.download)}>
38
+ {content.file.filename}
39
+ </a>{' '}
40
+ <span>
41
+ (
42
+ {(() => {
43
+ switch (content?.file['content-type']) {
44
+ case 'image/jpeg':
45
+ return 'JPEG';
46
+ case 'image/png':
47
+ return 'PNG';
48
+ case 'image/svg+xml':
49
+ return 'SVG';
50
+ case 'image/gif':
51
+ return 'GIF';
52
+ case 'application/pdf':
53
+ return 'PDF';
54
+ case 'application/msexcel':
55
+ return 'XLS';
56
+ case 'application/vnd.ms-excel':
57
+ return 'XLS';
58
+ case 'application/msword':
59
+ return 'DOC';
60
+ case 'application/mspowerpoint':
61
+ return 'PPT';
62
+ case 'audio/mp4':
63
+ return 'MP4';
64
+ case 'application/zip':
65
+ return 'ZIP';
66
+ case 'video/webm':
67
+ return 'WEBM';
68
+ case 'video/x-msvideo':
69
+ return 'AVI';
70
+ case 'video/x-sgi-movie':
71
+ return 'MOVIE';
72
+ case 'text/xml':
73
+ return 'XML';
74
+ case 'text/plain':
75
+ return 'TXT';
76
+ case 'text/calendar':
77
+ return 'ICS';
78
+ case 'image/x-icon':
79
+ return 'ICO';
80
+ case 'image/bmp':
81
+ return 'BMP';
82
+ case 'audio/mpeg':
83
+ return 'MP3';
84
+ case 'audio/wav':
85
+ return 'WAV';
86
+ case 'application/json':
87
+ return 'JSON';
88
+ case 'application/postscript':
89
+ return 'PS';
90
+ case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
91
+ return 'XLSX';
92
+ case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
93
+ return 'DOCX';
94
+ case 'application/xml':
95
+ return 'XML';
96
+ case 'application/mshelp':
97
+ return 'HLP';
98
+ case 'application/gzip':
99
+ return 'GZ';
100
+ default:
101
+ return '';
102
+ }
103
+ })()}{' '}
104
+ /{' '}
105
+ {content.file?.size < 1000000
106
+ ? Math.round(content.file.size / 1000)
107
+ : Math.round(content.file.size / 1000000)}
108
+ {content.file?.size < 1000000 ? 'KB' : 'MB'})
109
+ </span>
110
+ </>
111
+ )}
112
+ </div>
113
+ </Container>
114
+ );
115
+
116
+ /**
117
+ * Property types.
118
+ * @property {Object} propTypes Property types.
119
+ * @static
120
+ */
121
+ FileView.propTypes = {
122
+ content: PropTypes.shape({
123
+ title: PropTypes.string,
124
+ description: PropTypes.string,
125
+ file: PropTypes.shape({
126
+ download: PropTypes.string,
127
+ filename: PropTypes.string,
128
+ }),
129
+ }).isRequired,
130
+ };
131
+
132
+ export default FileView;
@@ -7,7 +7,7 @@ body.view-contentsview {
7
7
  }
8
8
 
9
9
  #main .breadcrumbs {
10
- padding: 2em 0;
10
+ padding: 20px 0;
11
11
  background-color: $lightgrey;
12
12
 
13
13
  .breadcrumb {
@@ -26,6 +26,10 @@ body.view-contentsview {
26
26
 
27
27
  .home {
28
28
  margin-right: 0.5em;
29
+
30
+ svg {
31
+ margin-bottom: -4px;
32
+ }
29
33
  }
30
34
 
31
35
  .section {
@@ -120,7 +120,28 @@
120
120
  }
121
121
 
122
122
  .contenttype-file {
123
- .content-area a {
124
- text-decoration: underline;
123
+ .content-area {
124
+ .documentFirstHeading {
125
+ max-width: var(--default-container-width) !important;
126
+ margin-right: auto;
127
+ margin-left: auto;
128
+ }
129
+ .file-detail {
130
+ max-width: var(--narrow-container-width) !important;
131
+ margin-right: auto;
132
+ margin-left: auto;
133
+ .documentDescription {
134
+ padding-top: 40px;
135
+ padding-bottom: 40px;
136
+ margin-bottom: 0;
137
+ }
138
+
139
+ a {
140
+ text-decoration: underline;
141
+ }
142
+ span {
143
+ color: #808080;
144
+ }
145
+ }
125
146
  }
126
147
  }
@@ -44,6 +44,13 @@ $narrow-container-width: 620px !default;
44
44
  }
45
45
  }
46
46
 
47
+ @mixin adjustMarginsToEditContainer($width) {
48
+ @container (max-width: #{$width + 2 * $spacing-medium}) {
49
+ margin-right: $spacing-medium;
50
+ margin-left: $spacing-medium;
51
+ }
52
+ }
53
+
47
54
  // Container adjustments for dealing correctly with absoluted elements
48
55
  @mixin container-preference-order($zindex) {
49
56
  position: relative;
@@ -102,12 +109,16 @@ footer {
102
109
  @include layout-container-width();
103
110
  }
104
111
 
105
- .header-wrapper .header,
106
- .breadcrumbs .breadcrumb {
112
+ .header-wrapper .header {
107
113
  @include layout-container-width();
108
114
  @include adjustMarginsToContainer($layout-container-width);
109
115
  }
110
116
 
117
+ .breadcrumbs .breadcrumb {
118
+ @include default-container-width();
119
+ @include adjustMarginsToContainer($default-container-width);
120
+ }
121
+
111
122
  // Content Layout Styling
112
123
  #page-document .blocks-group-wrapper {
113
124
  & > h2,
@@ -153,6 +164,7 @@ footer {
153
164
  & > .block.introduction .block-container,
154
165
  & > .block.teaser .teaser-item.default,
155
166
  & > .table-of-contents,
167
+ & > .accordion-block,
156
168
  & > .slate blockquote {
157
169
  @include default-container-width();
158
170
  @include adjustMarginsToContainer($default-container-width);
@@ -186,7 +198,7 @@ footer {
186
198
  #page-edit {
187
199
  [class*='block-editor-'] {
188
200
  @include layout-container-width();
189
- @include adjustMarginsToContainer($layout-container-width);
201
+ @include adjustMarginsToEditContainer($layout-container-width);
190
202
  }
191
203
  }
192
204
 
@@ -205,7 +217,7 @@ footer {
205
217
  .block-editor-codeBlock,
206
218
  .block-editor-mermaidBlock {
207
219
  @include narrow-container-width();
208
- @include adjustMarginsToContainer($narrow-container-width);
220
+ @include adjustMarginsToEditContainer($narrow-container-width);
209
221
  }
210
222
 
211
223
  .block-editor-title h1,
@@ -223,7 +235,7 @@ footer {
223
235
  .block-editor-teaser .teaser-item.default,
224
236
  .block-editor-toc {
225
237
  @include default-container-width();
226
- @include adjustMarginsToContainer($default-container-width);
238
+ @include adjustMarginsToEditContainer($default-container-width);
227
239
  }
228
240
 
229
241
  .block-editor-slate,
@@ -232,7 +244,7 @@ footer {
232
244
  .block-editor-teaser,
233
245
  .block-editor-separator.has--align--left {
234
246
  @include layout-container-width();
235
- @include adjustMarginsToContainer($layout-container-width);
247
+ @include adjustMarginsToEditContainer($layout-container-width);
236
248
  }
237
249
  }
238
250
 
@@ -2,3 +2,54 @@
2
2
  .block.accordion [data-rbd-draggable-context-id] {
3
3
  margin-bottom: 2rem;
4
4
  }
5
+
6
+ .accordion-block {
7
+ .ui.styled.accordion {
8
+ border-top: 1px solid $black;
9
+
10
+ &:last-child {
11
+ border-bottom: 1px solid $black;
12
+ }
13
+ .title.accordion-title {
14
+ padding: 20px 0 20px 0;
15
+ background-color: unset;
16
+
17
+ & > svg {
18
+ height: 50px !important;
19
+ fill: $grey !important;
20
+ transform: rotate(-90deg);
21
+ }
22
+
23
+ & > span {
24
+ @include introduction();
25
+ color: $darkGrey;
26
+ }
27
+
28
+ &.active > span {
29
+ color: $black;
30
+ }
31
+
32
+ &.active > svg {
33
+ fill: $black !important;
34
+ transform: rotate(180deg);
35
+ }
36
+ }
37
+
38
+ .block.listing {
39
+ &:first-child {
40
+ margin-top: 0;
41
+ }
42
+ .listing-item:last-child {
43
+ border-bottom: none !important;
44
+ }
45
+ }
46
+
47
+ .block:last-child {
48
+ margin-bottom: 0 !important;
49
+ }
50
+
51
+ .content {
52
+ padding: 0;
53
+ }
54
+ }
55
+ }
@@ -129,6 +129,9 @@
129
129
  }
130
130
 
131
131
  .block.listing {
132
+ &.previous--has--same--backgroundColor:not(.has--headline) {
133
+ margin-top: 0;
134
+ }
132
135
  h2 {
133
136
  margin-bottom: 40px !important;
134
137
  }
@@ -144,7 +147,7 @@
144
147
 
145
148
  .block-editor-empty {
146
149
  padding: 0;
147
- margin: 1rem 0.5rem 1rem 0.5rem !important;
150
+ margin: 0.5rem 0.5rem 0.5rem 0.5rem !important;
148
151
  }
149
152
  }
150
153
 
@@ -185,12 +185,13 @@
185
185
  }
186
186
  }
187
187
 
188
- &.previous--is--same--block-type.previous--has--same--backgroundColor:not(.has--headline) {
188
+ &.previous--has--same--backgroundColor:not(.has--headline) {
189
189
  margin-top: 200px;
190
190
  }
191
191
 
192
- p + &:not(.has--headline) {
193
- margin-top: 80px;
192
+ .documentFirstHeading
193
+ + &.previous--has--same--backgroundColor:not(.has--headline) {
194
+ margin-top: 0;
194
195
  }
195
196
  }
196
197