You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Bloom 5.7, we introduce a modernized, parameterized page layout CSS system, known as "Appearance". This new system conflicts with the arbitrary custom css that was used in prior Bloom versions, mostly in the area of margins.
2
2
3
-
As of this writing, we are only looking at `customBookStyles.css`, but `customCollectionsStyles.css`have the same problem.
3
+
As of this writing, we are looking at both `customBookStyles.css` and `customCollectionsStyles.css`, but not handling having both files with content, and not really dealing with `customCollectionStyles.css`being a collection wide settings file.
4
4
5
5
When Bloom encounters a pre-5.7 book with a `customBookStyles.css` that would conflict with the new system, it goes into a kind of "safe mode" that keeps things working by using a legacy `basePage.css`. Better, though, is to migrate the old css to the new system. Conceivably, a reliable program could be written to do this automatically. However at the moment what we do is to write the migrations using the utilities here, and then have a dev evaluate individual migrations and then copy them over to the shipping Bloom. So when Bloom encounters one of these books, we may already have a tested migration for it.
6
6
7
7
# How to use this system
8
8
9
9
⚠️ Be careful what you commit to an open source repo. We do not want to expose emails or other private data.
10
10
11
-
1.As of this writing, bun only works on linux. If you are on windows, just install Windows Subsystem for Linux (not as big of a deal as it sounds), then run in a WSL terminal in VSCODE.
11
+
1. As of this writing, bun works only on linux. If you are on windows, just install Windows Subsystem for Linux (not as big of a deal as it sounds), then run in a WSL terminal in VSCODE.
12
12
13
-
1. Get [bun](https://bun.sh/) installed
13
+
2. Get [bun](https://bun.sh/) installed
14
14
15
-
1. Install dependencies: `bun install`
16
-
17
-
1. Download all the `customBookStyles.css` from blorg
15
+
3. Choose (or create) a folder for working with CSS files and download all the `customBookStyles.css` and `customCollectionStyles.css` files from bloomlibrary.org. This will take some time.
18
16
19
17
`./some-path/BloomBulkDownloader.exe --include "*/*/custom*Styles.css" --syncfolder ./output/downloads --bucket production customBookStyles-files`
20
18
19
+
4. Download all the `meta.json` files from bloomlibrary.org. Again, this will take some time.
20
+
21
+
`./some-path/BloomBulkDownloader.exe --include "*/*/meta.json" --syncfolder ./output/downloads --bucket production customBookStyles-files`
22
+
21
23
Each of the following take an optional argument that will limit the number of records processed.
22
24
23
-
5.Process those, grouping them into bins of duplicate stylesheets
25
+
5. Process those, grouping them into bins of duplicate stylesheets
24
26
25
-
`bun run group-stylesheets.ts 13`
27
+
`bun run /path-to/group-stylesheets.ts 13`
26
28
27
-
1. Process those groups, discarding ones that don't need migration
29
+
6. Process those groups, discarding ones that don't need migration
Copy file name to clipboardExpand all lines: custom-css-analysis-and-migration/group-stylesheets.ts
+8-5
Original file line number
Diff line number
Diff line change
@@ -11,35 +11,38 @@ interface FileData {
11
11
}
12
12
13
13
constboilerplate=
14
-
'/* Some books may need control over aspects of layout that cannot yet be adjusted\r\n from the Bloom interface. In those cases, Bloom provides this "under the hood" method\r\n of creating style rules using the underlying "Cascading Stylesheets" system.\r\n These rules are then applied to all books in this collection. EDIT THIS FILE ONLY\r\n IN THE COLLECTION FOLDER: changes made to a copy found in the book folder will be\r\n lost the next time the book is edited with Bloom!\r\n\r\n Note: you can also add a file named "customBookStyles.css" in the book folder,\r\n to limit the effects of the rules to just that one book.\r\n\r\n You can learn about CSS from hundreds of books, or online. However chances are, if\r\n you need this customization, you will need an expert to create a version of this file\r\n for you, or give you rules that you can paste in below this line. */';
'/* Some books may need control over aspects of layout that cannot yet be adjusted\r\n from the Bloom interface. In those cases, Bloom provides this "under the hood" method\r\n of creating style rules using the underlying "Cascading Stylesheets" system. \r\n These rules are then applied to all books in this collection.\r\n\r\n Note: you can also add a file named "customBookStyles.css" in the book folder,\r\n to limit the effects of the rules to just that one book.\r\n \r\n You can learn about CSS from hundreds of books, or online. However chances are, if\r\n you need this customization, you will need an expert to create a version of this file\r\n for you, or give you rules that you can paste in below this line. */';
0 commit comments