Skip to content

Commit 6a19319

Browse files
petschkistevepiercy
andcommitted
Update docs/classic-ui/theming/barceloneta.md
Co-Authored-By: Steve Piercy <[email protected]>
1 parent 5e3a12d commit 6a19319

File tree

1 file changed

+59
-57
lines changed

1 file changed

+59
-57
lines changed

docs/classic-ui/theming/barceloneta.md

Lines changed: 59 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,28 @@ Barceloneta is the default enabled theme for Plone Classic UI.
1818

1919
## Create a Classic UI theme addon package
2020

21-
Create a Classic UI theme addon with `plonecli`:
21+
To create a addon package with a theme you need:
22+
23+
- [Node.js (16/18)](https://nodejs.org/en)
24+
- [Python (>=3.8)](https://www.python.org/)
25+
- [plonecli](https://pypi.org/project/plonecli/)
26+
27+
Create a Classic UI theme addon:
2228

2329
```shell
2430
plonecli create addon plonetheme.themebasedonbarceloneta
2531
```
2632

27-
Then change the working directory into the created package and add the
28-
basic theme structure with:
33+
Then change the working directory into the created package and add the basic theme structure:
2934

3035
```shell
3136
cd plonetheme.themebasedonbarceloneta
3237
plonecli add theme_barceloneta
3338
```
3439

3540
Give your theme a name and optionally commit the changes.
36-
After that the theming structure is setup and ready for customization.
41+
After that the theming structure is set up and ready for customization.
42+
You can create a Plone Site and install your theme addon in the controlpanel.
3743

3844

3945
(classic-ui-theming-barceloneta-theme-structure-label)=
@@ -42,7 +48,7 @@ After that the theming structure is setup and ready for customization.
4248

4349
All the theming relevant files are now located inside `src/plonetheme/themebasedonbarceloneta/theme/`:
4450

45-
```
51+
```text
4652
./src/plonetheme/themebasedonbarceloneta/theme/
4753
├── barceloneta-apple-touch-icon-114x114-precomposed.png
4854
├── barceloneta-apple-touch-icon-144x144-precomposed.png
@@ -70,55 +76,46 @@ All the theming relevant files are now located inside `src/plonetheme/themebased
7076
└── list.html
7177
```
7278

73-
### `index.html`
74-
75-
- Basic HTML structure for the site layout.
76-
77-
### `manifest.cfg`
79+
`index.html`
80+
: Basic HTML structure for the site layout.
7881

79-
- Basic theme configuration for the backend.
82+
`manifest.cfg`
83+
: Basic theme configuration for the backend.
8084

81-
### `package.json`
82-
83-
- npm package configuration which defines all requirements for theming
85+
`package.json`
86+
: npm package configuration which defines all requirements for theming
8487
with barceloneta.
8588

86-
### `rules.xml`
87-
88-
- Diazo rules which translate the `index.html` and fills it with content
89-
from the backend.
90-
91-
### `scss/_custom.scss`
92-
93-
- Custom SCSS rules for your theme.
89+
`rules.xml`
90+
: Diazo rules which translate the `index.html` and fills it with content from the backend.
9491

95-
### `scss/_maps.scss`
92+
`scss/_custom.scss`
93+
: Custom SCSS rules for your theme.
9694

97-
- Override Bootstrap mapping variables here.
95+
`scss/_maps.scss`
96+
: Override Bootstrap mapping variables here.
9897

99-
### `scss/_variables.scss`
98+
`scss/_variables.scss`
99+
: Override Bootstrap and/or Barceloneta variables here.
100100

101-
- Override Bootstrap and/or Barceloneta variables here.
101+
`scss/theme.scss`
102+
: Base theme file which follows "Option B" of customizing Bootstrap imports to enable custom variable and map injections.
103+
Note that the order of these imports is mandatory to ensure overriding the defaults.
104+
See https://getbootstrap.com/docs/5.3/customize/sass/#importing
102105

103-
### `scss/theme.scss`
106+
`styles/theme.css[.min]`
107+
: Compiled CSS styles.
104108

105-
- Base theme file which follows "Option B" of customizing Bootstrap imports
106-
to enable custom variable and map injections. Note that the order of these imports is mandatory to ensure overriding the defaults. See https://getbootstrap.com/docs/5.3/customize/sass/#importing
109+
`tinymce-templates/*.html`
110+
: HTML snippets for the TinyMCE `template` plugin.
107111

108-
### `styles/theme.css[.min]`
109112

110-
- Compiled CSS styles.
113+
(classic-ui-theming-barceloneta-compiling-theme-resources-label)=
111114

112-
### `tinymce-templates/*.html`
115+
## Compiling theme resources
113116

114-
- HTML snippets for the TinyMCE `template` plugin.
115-
116-
117-
(classic-ui-theming-barceloneta-npm-package-label)=
118-
119-
## npm package
120-
121-
To compile the SCSS code you have to install Node.js (v16+) and the required dependencies with `npm`. Then run the package script `build` inside the `theme/` folder:
117+
To compile the SCSS code you have to install the required dependencies with `npm`.
118+
Then run the package script `build` inside the `theme/` folder:
122119

123120
```shell
124121
npm install
@@ -131,52 +128,55 @@ During theme development you can run:
131128
npm run watch
132129
```
133130

134-
this compiles the SCSS resources on the fly when you change something inside
135-
the `scss/` folder.
131+
This compiles the SCSS resources on the fly when you change something inside the `scss/` folder.
132+
You can preview your changes when you reload your browser.
136133

137134

138135
(classic-ui-theming-barceloneta-customize-components-label)=
139136

140137
## Customize Bootstrap and Barceloneta components
141138

142-
The base `scss/theme.scss` file provides all imports of the dependent Bootstrap
143-
and Barceloneta resources to build the default Classic UI theme.
144-
As a convenience `bobtemplates.plone` has created three files to customize
145-
variables, maps and custom SCSS code.
139+
The base `scss/theme.scss` file provides all imports of the dependent Bootstrap and Barceloneta resources to build the default Classic UI theme.
140+
As a convenience `bobtemplates.plone` has created three files to customize variables, maps and custom SCSS code.
146141

147-
```
142+
```text
148143
scss/_custom.scss
149144
scss/_maps.scss
150145
scss/_variables.scss
151146
```
152147

148+
149+
(classic-ui-theming-barceloneta-scss-and-root-variables-label)=
150+
153151
### SCSS and root variables
154152

155-
To set a custom font you define the font variables in `scss/_variables.scss`:
153+
To set a custom font, you define the font variables in `scss/_variables.scss`:
156154

157155
```scss
158156
$font-family-sans-serif: Tahoma, Calimati, Geneva, sans-serif;
159157
$font-family-serif: Georgia, Norasi, serif;
160158
```
161159

162-
This will override the default values from barceloneta.
160+
This will override the default values from Barceloneta.
163161

164162

165-
### Properties
163+
### SCSS and properties
166164

167-
Same procedure if you want to disable rounded corners for borders:
165+
The following example shows how to disable rounded corners for borders.
168166

169167
```scss
170168
$enabled-rounded: false;
171169
```
172170

173-
A complete list of all properties see {ref}`classic-ui-theming-barceloneta-default-variables-properties-label`.
171+
A complete list of all properties see {ref}`classic-ui-theming-barceloneta-default-variables-and-properties-label`.
174172

175173

174+
(classic-ui-theming-barceloneta-maps-label)=
176175

177176
### Maps
178177

179-
Maps are key value pairs to make CSS generation easier. As an example this is the workflow colors map:
178+
Maps are key/value pairs to make CSS generation easier.
179+
As an example, the following example shows the workflow colors map:
180180

181181
```scss
182182
$state-colors: (
@@ -188,7 +188,7 @@ $state-colors: (
188188
) !default;
189189
```
190190

191-
If you have a custom workflow state you can add your state color to the default map. Just add the following to `scss/_maps.scss`:
191+
If you have a custom workflow state, you can add your state color to the default map in `scss/_maps.scss` as shown below.
192192

193193
```scss
194194
$custom-state-colors: (
@@ -199,14 +199,16 @@ $custom-state-colors: (
199199
$state-colors: map-merge($state-colors, $custom-colors);
200200
```
201201

202+
(classic-ui-theming-barceloneta-custom-css-code-label)=
202203

203204
### Custom CSS code
204205

205-
Inside the file `theme/_custom.scss` you can write all your custom CSS/Sass code
206-
to adapt the theme to your needs. Feel free to add more files inside the `scss/` folder to make your code more readable. Don't forget to import your custom files in `scss/theme.scss`.
206+
Inside the file `theme/_custom.scss` you can write all your custom CSS/Sass code to adapt the theme to your needs.
207+
Feel free to add more files inside the `scss/` folder to make your code more readable.
208+
Don't forget to import your custom files in `scss/theme.scss`.
207209

208210

209-
(classic-ui-theming-barceloneta-default-variables-properties-label)=
211+
(classic-ui-theming-barceloneta-default-variables-and-properties-label)=
210212

211213
## Default variables and properties
212214

0 commit comments

Comments
 (0)