Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
refactor: controlSection
Browse files Browse the repository at this point in the history
  • Loading branch information
y047aka committed Feb 11, 2024
1 parent ee7395e commit 859dbe3
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions example/src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,31 @@ playground :
}
-> Html msg
playground { isDarkMode, preview, controlSections } =
let
controlSection { heading, controls } =
div
[ css
[ padding (Css.em 0.75)
, displayFlex
, flexDirection column
, rowGap (Css.em 1)
, borderRadius (Css.em 0.5)
, palette (Palette.controlSection isDarkMode)
]
]
(header
[ css
[ displayFlex
, justifyContent spaceBetween
, alignItems center
, fontWeight bold
, empty [ display none ]
]
]
[ text heading ]
:: List.map Control.render controls
)
in
section
[ css
[ padding4 (Css.em 0.5) (Css.em 0.5) (Css.em 0.5) (Css.em 1.5)
Expand Down Expand Up @@ -671,33 +696,7 @@ playground { isDarkMode, preview, controlSections } =
, palette (Palette.controlPanel isDarkMode)
]
]
(List.map
(\{ heading, controls } ->
div
[ css
[ padding (Css.em 0.75)
, displayFlex
, flexDirection column
, rowGap (Css.em 1)
, borderRadius (Css.em 0.5)
, palette (Palette.controlSection isDarkMode)
]
]
(header
[ css
[ displayFlex
, justifyContent spaceBetween
, alignItems center
, fontWeight bold
, empty [ display none ]
]
]
[ text heading ]
:: List.map Control.render controls
)
)
controlSections
)
(List.map controlSection controlSections)
]


Expand Down

0 comments on commit 859dbe3

Please sign in to comment.