Skip to content

Commit

Permalink
Remove warning 32
Browse files Browse the repository at this point in the history
  • Loading branch information
davesnx committed Jul 9, 2024
1 parent 7653ee6 commit deec32a
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions packages/runtime/test/test_styles.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[@@@warning "-32"]

let get_string_style_rules () =
let content = CssJs.get_stylesheet () in
let _ = CssJs.flush () in
Expand All @@ -11,35 +9,6 @@ let one_property =
let css = get_string_style_rules () in
assert_string css (Printf.sprintf ".%s { display: block; }" classname)

let selector_nested_with_mq_and_declarations =
test "selector_nested_with_mq_and_declarations" @@ fun () ->
let mobile = "(max-width: 767px)" in
let classname =
[%cx
{|
li {
list-style-type: none;

::before {
position: absolute;
left: -20px;
content: "✓";
}

@media $(mobile) {
position: relative;
}
}
|}]
in
let css = get_string_style_rules () in
assert_string css
(Printf.sprintf
".%s li { list-style-type: none; } .%s li::before { position: absolute; \
left: -20px; content: \"\"; } @media (max-width: 767px) { .%s li { \
position: relative; } }"
classname classname classname)

let multiple_properties =
test "multiple_properties" @@ fun () ->
let classname =
Expand Down Expand Up @@ -364,6 +333,35 @@ let selector_ampersand_at_the_middle =
(Printf.sprintf ".%s { font-size: 42px; } .%s div .%s { font-size: 24px; }"
classname classname classname)

let selector_nested_with_mq_and_declarations =
test "selector_nested_with_mq_and_declarations" @@ fun () ->
let mobile = "(max-width: 767px)" in
let classname =
[%cx
{|
li {
list-style-type: none;

::before {
position: absolute;
left: -20px;
content: "✓";
}

@media $(mobile) {
position: relative;
}
}
|}]
in
let css = get_string_style_rules () in
assert_string css
(Printf.sprintf
".%s li { list-style-type: none; } .%s li::before { position: absolute; \
left: -20px; content: \"\"; } @media (max-width: 767px) { .%s li { \
position: relative; } }"
classname classname classname)

let mq =
test "mq" @@ fun () ->
let classname =
Expand Down

0 comments on commit deec32a

Please sign in to comment.