| 1 | # 5. Adopt ADRs (Architectural decision records) |
| 2 | |
| 3 | Date: 2024-03-11 |
| 4 | |
| 5 | ## Status |
| 6 | |
| 7 | Accepted |
| 8 | |
| 9 | ## Context |
| 10 | |
| 11 | As the team works on developing night mode, the largest hurdle remains user- |
| 12 | generated content. One particular class of user-generated content that we've |
| 13 | run up against is the use of inline styles to define a background color, with |
| 14 | the assumption the text color would remain constant. With the introduction of |
| 15 | night mode, this assumption is broken, and we are running into color contrast |
| 16 | issues for light-colored text on a background that was presumed to be |
| 17 | contrasting with a darker text color |
| 18 | |
| 19 | ## Decision |
| 20 | |
| 21 | After evaluating the expected performance impacts, we have decided that a CSS |
| 22 | approach targeting `[style*=background]` that sets the color explicitly to |
| 23 | `#333` would be sufficient to address this concern. While we considered a php- |
| 24 | based parser approach, it was found that the CSS approach was performant enough |
| 25 | to meet our needs and considerably more straightforward to implement |
| 26 | |
| 27 | See https://phabricator.wikimedia.org/T358240#9591458 for further details |
| 28 | |
| 29 | ## Consequences |
| 30 | |
| 31 | The most direct consequence of this change is that we will be modifying the |
| 32 | display of the page from what the authors explicitly intended for it to be. |
| 33 | We're quite confident that in the vast majority of cases this will not be an |
| 34 | issue, as the omission of font color was most likely predicated upon the |
| 35 | assumption it would remain the same in all cases, but we understand and |
| 36 | acknowledge that this could lead to issues where a user is unhappy with the |
| 37 | color being modified. To mitigate this issue, we have deliberately written the |
| 38 | style such that a defined color will take precendence over this, so ideally the |
| 39 | risk of this is low |