Skip to content

Commit 5fe80ea

Browse files
committed
visibility property
1 parent b49bf08 commit 5fe80ea

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3930,4 +3930,12 @@ mod tests {
39303930
}
39313931
);
39323932
}
3933+
3934+
#[test]
3935+
fn test_visibility() {
3936+
minify_test(".foo { visibility: visible }", ".foo{visibility:visible}");
3937+
minify_test(".foo { visibility: hidden }", ".foo{visibility:hidden}");
3938+
minify_test(".foo { visibility: collapse }", ".foo{visibility:collapse}");
3939+
minify_test(".foo { visibility: Visible }", ".foo{visibility:visible}");
3940+
}
39333941
}

src/properties/display.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,13 @@ impl ToCss for Display {
282282
}
283283
}
284284

285+
// https://drafts.csswg.org/css-display-3/#visibility
286+
enum_property!(Visibility,
287+
Visible,
288+
Hidden,
289+
Collapse
290+
);
291+
285292
#[derive(Default)]
286293
pub struct DisplayHandler {
287294
targets: Option<Browsers>,

src/properties/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ define_properties! {
204204
"opacity": Opacity(AlphaValue),
205205
"color": Color(CssColor),
206206
"display": Display(Display),
207+
"visibility": Visibility(Visibility),
207208

208209
"width": Width(Size),
209210
"height": Height(Size),

0 commit comments

Comments
 (0)