Skip to content

Commit 60db928

Browse files
committed
wip
1 parent 3e66042 commit 60db928

File tree

13 files changed

+127
-115
lines changed

13 files changed

+127
-115
lines changed

ghcjs/delivery-calculator/src/App/Widgets/Main.hs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ mainWidget :: Model -> View Action
1919
mainWidget st =
2020
div_
2121
[ style_
22-
[ ("padding", "0"),
23-
("margin", "0 auto"),
22+
[ ("margin", "0"),
23+
("padding", "0"),
24+
("min-width", "100%"),
2425
("max-width", "100%"),
2526
("min-height", "100vh"),
2627
("display", "flex"),
2728
("flex-direction", "column"),
2829
("justify-content", "space-between"),
29-
("align-items", "center")
30+
("align-items", "center"),
31+
("color", "inherit"),
32+
("background-color", "inherit")
3033
]
3134
]
3235
$ Menu.menu st
@@ -45,7 +48,7 @@ mainWidget st =
4548
]
4649
<> ( if not $ st ^. #modelLoading
4750
then mempty
48-
else [Spinner.spinner]
51+
else Spinner.spinner
4952
)
5053

5154
screenWidget :: Model -> [View Action]
@@ -96,7 +99,7 @@ screenWidget st@Model {modelState = St {stScreen = Main}} =
9699
then mempty
97100
else buttons
98101
)
99-
<> [ Flex.flexCol div_ id $ Asset.assetsViewer st <> totalViewer st
102+
<> [ Flex.flexCol main_ id $ Asset.assetsViewer st <> totalViewer st
100103
]
101104
<> buttons
102105
where
@@ -107,7 +110,15 @@ screenWidget st@Model {modelState = St {stScreen = Main}} =
107110
singleton
108111
$ Flex.flexRow
109112
p_
110-
id
113+
( mappend
114+
[ style_
115+
[ ("margin-left", "0"),
116+
("margin-right", "0"),
117+
("min-width", "100%"),
118+
("max-width", "100%")
119+
]
120+
]
121+
)
111122
[ button_
112123
[ type_ "submit",
113124
onClick . PushUpdate . Instant . ImpureUpdate $ do

ghcjs/delivery-calculator/src/App/Widgets/Menu.hs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,13 @@ menu :: Model -> [View Action]
2424
menu st =
2525
[ nav_
2626
[ style_
27-
[ ("width", "100%"),
28-
("display", "grid"),
29-
("align-items", "center"),
30-
("grid-template-columns", "auto 1fr auto auto auto auto")
27+
[ ("grid-template-columns", "auto 1fr auto auto auto auto")
3128
]
3229
]
3330
[ button_
3431
[ role_ "button",
3532
style_
36-
[ ("min-width", "0"),
37-
("justify-self", "start")
33+
[ ("min-width", "0")
3834
],
3935
onClick
4036
. PushUpdate
@@ -62,8 +58,7 @@ menu st =
6258
button_
6359
[ role_ "button",
6460
style_
65-
[ ("min-width", "0"),
66-
("justify-self", "end")
61+
[ ("min-width", "0")
6762
],
6863
onClick
6964
. PushUpdate
@@ -77,8 +72,7 @@ menu st =
7772
button_
7873
[ role_ "button",
7974
style_
80-
[ ("min-width", "0"),
81-
("justify-self", "end")
75+
[ ("min-width", "0")
8276
],
8377
onClick
8478
. PushUpdate
@@ -93,8 +87,7 @@ menu st =
9387
button_
9488
[ role_ "button",
9589
style_
96-
[ ("min-width", "0"),
97-
("justify-self", "end")
90+
[ ("min-width", "0")
9891
],
9992
onClick
10093
. PushUpdate
@@ -112,8 +105,7 @@ menu st =
112105
button_
113106
[ role_ "button",
114107
style_
115-
[ ("min-width", "0"),
116-
("justify-self", "end")
108+
[ ("min-width", "0")
117109
],
118110
onClick
119111
. PushUpdate

ghcjs/delivery-calculator/src/Main.hs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ viewModel :: Model -> View Action
248248
#if defined(__GHCJS__) || defined(ghcjs_HOST_OS) || defined(wasi_HOST_OS)
249249
viewModel st =
250250
prependViews
251-
(
252-
( if not (st ^. #modelState . #stEnableTheme)
251+
( ( if not (st ^. #modelState . #stEnableTheme)
253252
then mempty
254253
else
255254
[ link_
@@ -272,6 +271,11 @@ viewModel st =
272271
--
273272
prependViews
274273
(
274+
[ link_
275+
[ rel_ "stylesheet",
276+
href_ $ "miso-functora/pre-theme.css"
277+
]
278+
] <>
275279
( if not (st ^. #modelState . #stEnableTheme)
276280
then mempty
277281
else
@@ -283,7 +287,7 @@ viewModel st =
283287
) <>
284288
[ link_
285289
[ rel_ "stylesheet",
286-
href_ $ "miso-functora/miso-functora.css"
290+
href_ $ "miso-functora/post-theme.css"
287291
]
288292
]
289293
)

ghcjs/miso-functora/dist/miso-functora/miso-functora.min.css renamed to ghcjs/miso-functora/dist/miso-functora/post-theme.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ghcjs/miso-functora/dist/miso-functora/pre-theme.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ghcjs/miso-functora/dist/themes/thao.min.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

ghcjs/miso-functora/lib/miso-functora/miso-functora.css renamed to ghcjs/miso-functora/lib/miso-functora/post-theme.css

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,39 @@
11
@import url(../fa/css/all.min.css);
22

33
* {
4+
box-sizing: border-box !important;
45
overflow-wrap: anywhere;
56
}
67

7-
html {
8-
width: 100%;
9-
min-height: 100vh;
10-
}
11-
128
html,
13-
main {
9+
body {
1410
margin: 0;
1511
padding: 0;
12+
min-width: 100%;
13+
max-width: 100%;
14+
min-height: 100vh;
1615
}
1716

18-
body {
19-
width: 100%;
20-
padding: 0;
21-
margin: 0 auto;
17+
nav {
18+
min-width: 100% !important;
19+
max-width: 100% !important;
20+
display: grid !important;
21+
align-items: center !important;
22+
justify-content: center !important;
23+
z-index: initial !important;
24+
position: initial !important;
25+
}
26+
27+
button {
28+
margin: 0.25rem 0.125rem;
29+
padding-left: 1rem;
30+
padding-right: 1rem;
2231
}
2332

2433
header,
2534
footer {
26-
width: 100% !important;
35+
min-width: 100% !important;
36+
max-width: 100% !important;
2737
margin-left: 0 !important;
2838
margin-right: 0 !important;
2939
padding-left: 0 !important;
@@ -32,15 +42,8 @@ footer {
3242

3343
footer:before,
3444
footer:after {
35-
width: 100%;
36-
}
37-
38-
nav {
39-
padding-left: 0 !important;
40-
padding-right: 0 !important;
41-
margin-bottom: 1rem;
42-
z-index: initial !important;
43-
position: initial !important;
45+
min-width: 100%;
46+
max-width: 100%;
4447
}
4548

4649
textarea {
@@ -49,25 +52,25 @@ textarea {
4952
}
5053

5154
dialog {
52-
width: 100%;
55+
position: fixed !important;
56+
top: 0 !important;
57+
left: 0 !important;
58+
width: 100% !important;
59+
max-width: min(100%, 640px) !important;
5360
height: fit-content !important;
54-
max-height: calc(100% - 4rem) !important;
55-
max-width: min(calc(100% - 4rem), 640px) !important;
56-
overflow: auto;
57-
margin: auto !important;
58-
padding: 1rem;
61+
max-height: 100% !important;
62+
overflow: auto !important;
63+
margin: 0 auto !important;
64+
padding: 1rem !important;
5965
z-index: 9999 !important;
6066
display: initial;
6167
position: initial;
6268
transform: initial;
6369
}
6470

65-
button {
66-
margin: 0.25rem 0.125rem !important;
67-
padding-top: 4px;
68-
padding-bottom: 4px;
69-
padding-left: 12px;
70-
padding-right: 12px;
71+
dialog:before,
72+
dialog:after {
73+
all: initial;
7174
}
7275

7376
@media print {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
html,
2+
body {
3+
color: black;
4+
background-color: white;
5+
}
6+
7+
main,
8+
form,
9+
select,
10+
option,
11+
dialog {
12+
color: inherit;
13+
background-color: inherit;
14+
}

ghcjs/miso-functora/src/Functora/Miso/Theme.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ data Theme
126126
Tacit |
127127
Tent |
128128
Terminal |
129-
Thao |
130129
Vanilla |
131130
Vital |
132131
W3cChocolate |

ghcjs/miso-functora/src/Functora/Miso/Widgets/Dialog.hs

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ dialog opts args =
5656
if not opened
5757
then mempty
5858
else
59-
singleton
60-
. FixedOverlay.fixedOverlay
61-
[ role_ "button",
62-
onClick $ closeDialogAction opts args
63-
]
59+
FixedOverlay.fixedOverlay
60+
[ role_ "button",
61+
onClick $ closeDialogAction opts args
62+
]
6463
. singleton
6564
. nodeHtml "dialog" [boolProp "open" True]
6665
$ Flex.flexLeftRight
@@ -69,8 +68,8 @@ dialog opts args =
6968
(optsHeaderLeft opts defHeaderLeft)
7069
(optsHeaderRight opts defHeaderRight)
7170
<> ( if optsFlexContent opts
72-
then [Flex.flexCol main_ id (argsContent args)]
73-
else argsContent args
71+
then [Flex.flexCol form_ id $ argsContent args]
72+
else [form_ mempty $ argsContent args]
7473
)
7574
<> Flex.flexLeftRight
7675
footer_
@@ -82,28 +81,17 @@ dialog opts args =
8281
args ^? #argsModel . cloneTraversal (argsOptic args) == Just Opened
8382
defHeaderStyle =
8483
style_
85-
[ ("margin", "0"),
86-
("display", "flex"),
84+
[ ("display", "flex"),
8785
("align-items", "center")
8886
]
8987
defHeaderLeft =
90-
maybeToList
91-
( fmap
92-
( h2_
93-
[ defHeaderStyle,
94-
style_ [("margin-right", "0.5em")]
95-
]
96-
. singleton
97-
. optsIcon opts
98-
)
99-
$ optsTitleIcon opts
100-
)
101-
<> maybeToList
102-
( fmap
103-
( h2_ [defHeaderStyle] . singleton . text
104-
)
105-
$ optsTitle opts
106-
)
88+
singleton
89+
. h3_ [defHeaderStyle]
90+
. intersperse (rawHtml "&nbsp;")
91+
$ catMaybes
92+
[ optsIcon opts <$> optsTitleIcon opts,
93+
text <$> optsTitle opts
94+
]
10795
defHeaderRight =
10896
[ button_
10997
[onClick $ closeDialogAction opts args]

0 commit comments

Comments
 (0)