View Issue Details

IDProjectCategoryView StatusLast Update
0005027Composr alpha bug reports[All Projects] General / Uncategorisedpublic2022-12-20 23:20
ReporterPatrick SchmalstigAssigned ToPatrick Schmalstig 
SeverityMinor-bug 
Status resolvedResolutionfixed 
Summary0005027: Theme wizard: Inconsistencies with generated themes
DescriptionThere are a few areas to check into when generating a new theme using the theme wizard in v11:

* New themes seem to set their own settings in theme.ini that are not congruent with the default theme, e.g. using regular icons instead of monochrome, disabling the homepage banner, etc. Perhaps these should be "advanced" settings on the theme wizard screen that an admin can define?

* Theme wizard also seems to modify the default theme's theme.ini after creating a new theme from it.

* Generating a theme using HSV shift creates a dark background (looks like a permanent overlay is activated, but I don't think there is).

* Light / bright colors are not properly contrasted:
- links and menu items are barely visible
- button text remains white against the bright background color when it should be black.
- Table header text not properly contrasted (still white instead of black)
- Borders are barely visible

* Dark mode needs heavy work: Lots of areas where text or icons are too dark

* CSS breaks / does not load correctly for white and black seeded themes.
TagsRoadmap: v11
Sponsorship open

Activities

Patrick Schmalstig

2022-12-15 22:24

administrator   ~0007794

First item: options already exist in edit theme

Second item: Not true

Patrick Schmalstig

2022-12-15 22:47

administrator   ~0007795

Item 3: It's not necessarily making it dark but it's modifying WB and BW when it should not be.

Patrick Schmalstig

2022-12-16 21:37

administrator   ~0007800

"* CSS breaks / does not load correctly for white and black seeded themes."

This is not conditional to seed. Also, it usually resolves itself after the first page load (except for previews which re-generate on every page load).

>> All other bullets in this issue are resolved, although there may still be a few hidden colour contrast issues in themes.

Patrick Schmalstig

2022-12-18 02:27

administrator   ~0007806

Also changed the "warn" buttons on the forum to a warning colour. I originally thought about doing the same for the report buttons but decided not.

Patrick Schmalstig

2022-12-18 02:32

administrator   ~0007807

Also added luminance and colour contrast functions to themewizard.php .

---
Added new themewizard equation: contrast. This outputs a new colour given the provided contrast ratio (the HSV value and saturation are adjusted until the contrast ratio is met or both value and saturation reached their min/max allowed).

Example use: {$THEMEWIZARD_COLOR,#ffffff,seed_contrast_medium,100% (seed contrast 4.5)} [outputs a new color that has a contrast ratio of up to 4.5 compared to the seed colour]

---
Added {$THEME_COLOUR_IS_BRIGHT,colour} Tempcode symbol. Returns 1 if the luminance of the specified colour is 0.5 or higher, else returns 0. Can be used to determine when to use white versus black text. For example:

/*{+START,IF,{$THEME_COLOUR_IS_BRIGHT,{$GET,button_primary}}}*/
    .btn-primary img.icon {
        /* When the buttons are bright, we do not want their icons to be white after-all */
        filter: none !important;
    }
/*{+END}*/

This makes the icons on the primary buttons black when the button colour is bright.

Patrick Schmalstig

2022-12-18 05:21

administrator   ~0007808

Last edited: 2022-12-18 05:43

View 3 revisions

With my latest commit ( https://gitlab.com/composr-foundation/composr/-/commit/b2f52d9aa84f338e6903e857271f55bd91333e7f ), box_title_text_2 was changed from white to black automatically for the default theme / seed due to the new contrast ratio calculator.

Black seems to be less visible against the seed background than white was, so I thought this was a bug. However, when I calculated the black / white color contrasts, black came out at 5.31 whereas white was 3.95. So technically, the theme wizard was correct in choosing black according to WCAG standards despite it looking less visible to me personally.

May want to review this more. Maybe the WCAG algorithm is flawed.

Edit: The WCAG 2.0 standard is indeed flawed. WCAG 3.0 / APCA is much more accurate.

Chris Graham

2022-12-20 22:20

administrator   ~0007820

Is this all resolved now?

Patrick Schmalstig

2022-12-20 23:20

administrator   ~0007823

Yes.

Additional note, while what I said above about WCAG 2.1 is true and that I still recommend WCAG 3.0 / APCA, a good PHP implementation is not yet available. So I'm using luminance instead of contrast ratio to determine black versus white text.

Issue History

Date Modified Username Field Change
2022-11-14 14:46 Patrick Schmalstig New Issue
2022-11-14 14:53 Patrick Schmalstig Description Updated View Revisions
2022-11-14 14:54 Patrick Schmalstig Description Updated View Revisions
2022-11-14 15:57 Patrick Schmalstig Severity Feature-request => Minor-bug
2022-11-14 15:58 Patrick Schmalstig Assigned To => Chris Graham
2022-11-14 15:58 Patrick Schmalstig Status non-assigned => assigned
2022-11-20 02:53 Chris Graham Tag Attached: Roadmap: v11
2022-11-28 19:58 Chris Graham Assigned To Chris Graham => Patrick Schmalstig
2022-12-05 14:38 Patrick Schmalstig Description Updated View Revisions
2022-12-05 15:38 Patrick Schmalstig Description Updated View Revisions
2022-12-15 22:24 Patrick Schmalstig Note Added: 0007794
2022-12-15 22:47 Patrick Schmalstig Note Added: 0007795
2022-12-16 00:19 Patrick Schmalstig Description Updated View Revisions
2022-12-16 21:37 Patrick Schmalstig Note Added: 0007800
2022-12-18 02:27 Patrick Schmalstig Note Added: 0007806
2022-12-18 02:32 Patrick Schmalstig Note Added: 0007807
2022-12-18 05:21 Patrick Schmalstig Note Added: 0007808
2022-12-18 05:21 Patrick Schmalstig Note Edited: 0007808 View Revisions
2022-12-18 05:43 Patrick Schmalstig Note Edited: 0007808 View Revisions
2022-12-20 22:20 Chris Graham Note Added: 0007820
2022-12-20 23:20 Patrick Schmalstig Note Added: 0007823
2022-12-20 23:20 Patrick Schmalstig Status assigned => resolved
2022-12-20 23:20 Patrick Schmalstig Resolution open => fixed
2023-02-26 18:29 Chris Graham Category General => General / Uncategorised