View Issue Details

IDProjectCategoryView StatusLast Update
5027Composr alpha bug reportsGeneral / Uncategorisedpublic2022-12-20 23:20
ReporterPDStig Assigned ToPDStig  
PrioritynormalSeverityminor 
Status resolvedResolutionfixed 
Summary5027: 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
Attach Tags
Sponsorship open

Sponsor

Date Added Member Amount Sponsored

Activities

PDStig

2022-12-15 22:24

administrator   ~7794

First item: options already exist in edit theme

Second item: Not true

PDStig

2022-12-15 22:47

administrator   ~7795

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

PDStig

2022-12-16 21:37

administrator   ~7800

"* 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.

PDStig

2022-12-18 02:27

administrator   ~7806

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.

PDStig

2022-12-18 02:32

administrator   ~7807

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.

PDStig

2022-12-18 05:21

administrator   ~7808

Last edited: 2022-12-18 05:43

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   ~7820

Is this all resolved now?

PDStig

2022-12-20 23:20

administrator   ~7823

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 PDStig New Issue
2022-11-14 14:53 PDStig Description Updated
2022-11-14 14:54 PDStig Description Updated
2022-11-14 15:57 PDStig Severity Feature or Request => Minor Bug
2022-11-14 15:58 PDStig Assigned To => Chris Graham
2022-11-14 15:58 PDStig Status Not Assigned => Assigned
2022-11-20 02:53 Chris Graham Tag Attached: Roadmap: v11
2022-11-28 19:58 Chris Graham Assigned To Chris Graham => user4172
2022-12-05 14:38 PDStig Description Updated
2022-12-05 15:38 PDStig Description Updated
2022-12-15 22:24 PDStig Note Added: 0007794
2022-12-15 22:47 PDStig Note Added: 0007795
2022-12-16 00:19 PDStig Description Updated
2022-12-16 21:37 PDStig Note Added: 0007800
2022-12-18 02:27 PDStig Note Added: 0007806
2022-12-18 02:32 PDStig Note Added: 0007807
2022-12-18 05:21 PDStig Note Added: 0007808
2022-12-18 05:21 PDStig Note Edited: 0007808
2022-12-18 05:43 PDStig Note Edited: 0007808
2022-12-20 22:20 Chris Graham Note Added: 0007820
2022-12-20 23:20 PDStig Note Added: 0007823
2022-12-20 23:20 PDStig Status Assigned => Resolved
2022-12-20 23:20 PDStig Resolution open => fixed
2023-02-26 18:29 Chris Graham Category General => General / Uncategorised