Skip to content

Commit

Permalink
extend logic to use andIf() to set css classes.
Browse files Browse the repository at this point in the history
Co-authored-by: Adrian Santana Berg <[email protected]>
  • Loading branch information
jonasbrunvoll and adriansberg committed May 30, 2024
1 parent 0e9634e commit 9404996
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/widget/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { SearchTime } from '@atb/modules/search-time/types';
import Combobox from '@github/combobox-nav';

import style from './widget.module.css';
import { andIf } from '../utils/css';

const DEFAULT_DEBOUNCE_TIME = 300;

Expand Down Expand Up @@ -723,11 +724,13 @@ function createOutput(

const output = html`
<div
class="${style.wrapper} ${style.lightWrapper} ${outputOverrideOptions.inheritFont
? style.inheritFont
: ''} ${outputOverrideOptions.singleColumnLayout
? style.singleColumnLayout
: ''}"
class="${andIf({
[style.wrapper]: true,
[style.lightWrapper]: true,
[style.inheritFont]: outputOverrideOptions.inheritFont ?? false,
[style.singleColumnLayout]:
outputOverrideOptions.singleColumnLayout ?? false,
})}"
>
<nav class="${style.nav}">
<ul class="${style.tabs} js-tablist">
Expand Down

0 comments on commit 9404996

Please sign in to comment.