use of com.helger.css.writer.CSSWriter in project ph-css by phax.
the class WikiCreateFontFaceRuleFuncTest method test.
@Test
public void test() {
final CascadingStyleSheet aCSS = WikiCreateFontFaceRule.createFontFace("Your \"typeface\"", "local font name", "folder/", "myfont");
final String sCSS = new CSSWriter(ECSSVersion.CSS30).getCSSAsString(aCSS);
System.out.println(sCSS);
final CascadingStyleSheet aCSS2 = CSSReader.readFromString(sCSS, ECSSVersion.CSS30);
assertNotNull(aCSS2);
assertEquals(aCSS, aCSS2);
}
use of com.helger.css.writer.CSSWriter in project ph-css by phax.
the class MediaQueryToolsTest method testGetWrapped.
@Test
public void testGetWrapped() {
// Read and arbitrary CSS
final CascadingStyleSheet aBaseCSS = CSSReader.readFromString("p { color:red;}", s_eVersion);
assertNotNull(aBaseCSS);
// Create structured media queries
final List<CSSMediaQuery> aMQs = MediaQueryTools.parseToMediaQuery("screen", s_eVersion);
assertNotNull(aMQs);
// Wrap the source CSS with the specified media queries
final CascadingStyleSheet aWrappedCSS = MediaQueryTools.getWrappedInMediaQuery(aBaseCSS, aMQs, false);
assertNotNull(aWrappedCSS);
assertEquals("@media screen{p{color:red}}", new CSSWriter(s_eVersion, true).getCSSAsString(aWrappedCSS));
}
use of com.helger.css.writer.CSSWriter in project ph-css by phax.
the class IssueGC18Test method testIssue18.
@Test
public void testIssue18() {
final IReadableResource aRes = new ClassPathResource("testfiles/css30/good/issue-gc-18.css");
assertTrue(aRes.exists());
final CascadingStyleSheet aCSS = CSSReader.readFromStream(aRes, StandardCharsets.UTF_8, ECSSVersion.CSS30, new LoggingCSSParseErrorHandler());
assertNotNull(aCSS);
if (false)
System.out.println(new CSSWriter(ECSSVersion.CSS30).getCSSAsString(aCSS));
}
Aggregations