本文整理汇总了Java中com.helger.css.ECSSVersion.CSS21属性的典型用法代码示例。如果您正苦于以下问题:Java ECSSVersion.CSS21属性的具体用法?Java ECSSVersion.CSS21怎么用?Java ECSSVersion.CSS21使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.helger.css.ECSSVersion
的用法示例。
在下文中一共展示了ECSSVersion.CSS21属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCompressCSS_Size
@Test
public void testCompressCSS_Size ()
{
final CascadingStyleSheet aCSS = CSSReader.readFromStream (new ClassPathResource ("/testfiles/css21/good/phloc/test/content.css"),
StandardCharsets.UTF_8,
ECSSVersion.CSS30);
assertNotNull (aCSS);
// Only whitespace optimization
final CSSWriterSettings aSettings = new CSSWriterSettings (ECSSVersion.CSS21, true);
String sContent = new CSSWriter (aSettings).getCSSAsString (aCSS);
assertEquals (2846, sContent.length ());
// Also remove empty declarations
aSettings.setRemoveUnnecessaryCode (true);
sContent = new CSSWriter (aSettings).getCSSAsString (aCSS);
assertEquals (2839, sContent.length ());
}
示例2: getMinimumCSSVersion
@Nonnull
public ECSSVersion getMinimumCSSVersion ()
{
if (m_aMembers.containsAny (m -> m instanceof CSSPageMarginBlock))
return ECSSVersion.CSS30;
return ECSSVersion.CSS21;
}