Skip to content

Commit ef89b06

Browse files
authored
Merge pull request #1592 from plone/gforcada-patch-1
feat(classic UI): how to get a minimal barceloneta integration
2 parents 59d6a71 + cc19c64 commit ef89b06

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

docs/classic-ui/theming/from-scratch.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ prefix = /++theme++plonetheme.munich
6666
doctype = <!DOCTYPE html>
6767
```
6868

69+
(classic-ui-from-scratch-bundle-registration-label)=
70+
6971
### Bundle registration
7072

7173
```xml
@@ -120,7 +122,61 @@ yarn dist
120122
- Tweak basic settings like rounded corners, shadows, and so on.
121123
- Set custom fonts
122124
- Define your own stuff
123-
- Import Boostrap (as basis)
125+
- Import Bootstrap (as basis)
126+
127+
128+
#### Minimal backend styling
129+
130+
When you create a theme from scratch, it is convenient to reuse the Barceloneta theme for:
131+
132+
- Plone toolbar
133+
- add and edit forms
134+
- control panels
135+
136+
To do so, follow this guide.
137+
138+
- Create a new CSS file in your theme, such as the following.
139+
140+
```scss
141+
@import "@plone/plonetheme-barceloneta-base/scss/variables.colors.plone";
142+
@import "@plone/plonetheme-barceloneta-base/scss/variables.colors.dark.plone";
143+
@import "@plone/plonetheme-barceloneta-base/scss/root_variables";
144+
@import "bootstrap/scss/bootstrap";
145+
146+
@import "@plone/plonetheme-barceloneta-base/scss/toolbar";
147+
@import "@plone/plonetheme-barceloneta-base/scss/controlpanels";
148+
@import "@plone/plonetheme-barceloneta-base/scss/forms";
149+
```
150+
151+
```{tip}
152+
See all the available [Barceloneta SCSS files](https://github.com/plone/plonetheme.barceloneta/tree/master/scss), and import the ones that you want to use.
153+
```
154+
155+
- Add `@plone/plonetheme-barceloneta-base` as a dependency.
156+
157+
```shell
158+
yarn add @plone/plonetheme-barceloneta-base
159+
```
160+
161+
- Add a script in {file}`package.json` to compile the CSS.
162+
163+
```json
164+
"css-compile-main": "sass --load-path=node_modules --style expanded --source-map --embed-sources --no-error-css plone.scss:../static/plone.css"
165+
```
166+
167+
```{tip}
168+
Look at [`plonetheme.barcelonta`'s {file}`package.json`](https://github.com/plone/plonetheme.barceloneta/blob/master/package.json) for a few more scripts that can prefix and minify your CSS and get a bundle for use in production.
169+
```
170+
171+
- Run the compilation.
172+
173+
```shell
174+
yarn run css-compile-main
175+
```
176+
177+
- Finally, {ref}`register the bundle <classic-ui-from-scratch-bundle-registration-label>`.
178+
179+
With this guide, you will save yourself quite some work on styling the toolbar, the add and edit forms, and control panels, while keeping the rest of your theming separate.
124180

125181

126182
#### Templates

0 commit comments

Comments
 (0)