fix(labels): text and background combination in dark mode
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2024-01-21 20:20:00 +01:00
parent 57c99a22a0
commit b8c21c2ade
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 11 additions and 1 deletions

View File

@ -27,7 +27,17 @@ export default class LabelModel extends AbstractModel<ILabel> implements ILabel
if (this.hexColor !== '' && this.hexColor.substring(0, 1) !== '#') {
this.hexColor = '#' + this.hexColor
}
this.textColor = colorIsDark(this.hexColor) ? '#4a4a4a' : '#fff'
if (this.hexColor === '') {
this.hexColor = 'var(--grey-200)'
this.textColor = 'var(--grey-800)'
} else {
this.textColor = colorIsDark(this.hexColor)
// Fixed colors to avoid flipping in dark mode
? 'hsl(215, 27.9%, 16.9%)' // grey-800
: 'hsl(220, 13%, 91%)' // grey-200
}
this.createdBy = new UserModel(this.createdBy)
this.created = new Date(this.created)