Skip to content

Commit 2cc91a2

Browse files
committed
Docs. Added example CSS file for adding backgrounds to entries depending on their calendar.
1 parent eb029d6 commit 2cc91a2

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

docs/Development.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Checklist for releases
101101
* Run test_entries.py, test_repeats.py, test_import_paste.py & test_ongoing.py
102102
unit tests
103103
* Check all test files (testxx_*.ics & generated files) display correctly
104-
* Check darkmode & backgrounds CSS still work
104+
* Check darkmode, backgrounds & calendar colours CSS examples still work
105105
* Check mouse clicks/touchscreen taps/swipes work (all views)
106106
* Check start_week_day!=Monday still works (all views)
107107
* Increase version number in pygenda_version.py & pyproject.toml
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* CSS example for adding coloured backgrounds to entries
2+
* according to the calendar where they are stored.
3+
*/
4+
5+
6+
/* Styling for entries where a background colour is wanted.
7+
* In this example we have two calendars: "work" & "personal".
8+
*
9+
* Class names for calendars are in the form "calendar-xxx"
10+
* where xxx can be set in the .ini file, calendar property
11+
* "class" (defaults to the calendar display name in lower
12+
* case with punctuation removed & spaces replaced with dashes).
13+
*/
14+
.calendar-work > .itemtext,
15+
.calendar-personal > .itemtext {
16+
border-radius:0.3em;
17+
padding:0.2em;
18+
padding-top:0;
19+
margin-bottom:5px;
20+
margin-right:5px;
21+
box-shadow:2px 2px 3px 0px black;
22+
}
23+
24+
/* Tweak spacing above whole entry, so entry bullet & text are aligned */
25+
.calendar-work,
26+
.calendar-personal {
27+
margin-top:1px;
28+
}
29+
30+
/* Assign background colours to specific calendars */
31+
.calendar-work > .itemtext {
32+
background:Khaki;
33+
}
34+
35+
.calendar-personal > .itemtext {
36+
background:PowderBlue;
37+
}
38+
39+
/* Customisation notes:
40+
*
41+
* To just add backgrounds in one view, add the xxxxview_item class.
42+
* For example, change .calendar-work to .weekview_item.calendar-work
43+
*
44+
* To only select events, or only todos, in Week/Year view, add the
45+
* appropriate selector. For example, change .calendar-work to
46+
* .event.calendar-work or .todo.calendar-work
47+
*/

0 commit comments

Comments
 (0)