use of com.vaadin.flow.dom.Style in project flow by vaadin.
the class ElementTest method styleGetNamesDashAndCamelCase.
@Test
public void styleGetNamesDashAndCamelCase() {
Element element = ElementFactory.createDiv();
Style style = element.getStyle();
style.set("borderColor", "blue");
style.set("border-foo", "bar");
List<String> styles = style.getNames().collect(Collectors.toList());
Assert.assertEquals(2, styles.size());
Assert.assertTrue(styles.contains("border-color"));
Assert.assertTrue(styles.contains("border-foo"));
}
use of com.vaadin.flow.dom.Style in project flow by vaadin.
the class ElementTest method getUnsetStyle.
@Test
public void getUnsetStyle() {
Element e = ElementFactory.createDiv();
Style s = e.getStyle();
Assert.assertNull(s.get("foo"));
}
use of com.vaadin.flow.dom.Style in project flow by vaadin.
the class ElementTest method replaceStyle.
@Test
public void replaceStyle() {
Element e = ElementFactory.createDiv();
Style s = e.getStyle();
s.set("foo", "bar");
s.set("foo", "baz");
Assert.assertEquals("baz", s.get("foo"));
}
use of com.vaadin.flow.dom.Style in project flow by vaadin.
the class ElementTest method useCustomPropertyStyle.
@Test
public void useCustomPropertyStyle() {
Element element = ElementFactory.createDiv();
Style style = element.getStyle();
style.set("color", "var(--some-var)");
Assert.assertEquals("var(--some-var)", style.get("color"));
}
use of com.vaadin.flow.dom.Style in project flow by vaadin.
the class ElementTest method setStyle.
public void setStyle() {
Element e = ElementFactory.createDiv();
Style s = e.getStyle();
s.set("foo", "bar");
Assert.assertEquals("bar", s.get("foo"));
}
Aggregations