fix: fixed dropdown styling

This commit is contained in:
ThinLiquid 2024-02-02 03:34:18 +00:00 committed by GitHub
parent 3a64f5801a
commit 470a1fa1e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,8 +30,8 @@ const Components: Library = {
function shiftColor (col: string, amt: number): string { function shiftColor (col: string, amt: number): string {
const num = parseInt(col, 16) const num = parseInt(col, 16)
const r = (num >> 16) + amt const r = (num >> 16) + amt
const b = ((num >> 8) & 0x00FF) + amt const b = ((num >> 8) & 0x00_FF) + amt
const g = (num & 0x0000FF) + amt const g = (num & 0x00_00_FF) + amt
const newColor = g | (b << 8) | (r << 16) const newColor = g | (b << 8) | (r << 16)
return newColor.toString(16) return newColor.toString(16)
} }
@ -52,7 +52,7 @@ const Components: Library = {
button.style({ button.style({
background: 'var(--primary)', background: 'var(--primary)',
color: 'var(--base)', color: 'var(--base)',
border: '1px solid #' + shiftColor(document.documentElement.style.getPropertyValue('--primary').replace('#', ''), -40) + '' border: `1px solid #${shiftColor(document.documentElement.style.getPropertyValue('--primary').replace('#', ''), -40)}`
}) })
} }
return button return button
@ -77,11 +77,9 @@ const Components: Library = {
'border-radius': '5px', 'border-radius': '5px',
padding: '2.5px', padding: '2.5px',
background: 'var(--base)', background: 'var(--base)',
border: '1px solid const(--surface-1)' border: '1px solid var(--surface-1)'
}).appendMany( }).appendMany(
...options.map((option) => { ...options.map((option) => new HTML('option').text(option))
return new HTML('option').text(option)
})
) )
return dropdown return dropdown
} }