How to use the weasyprint.css.utils.single_keyword function in weasyprint

To help you get started, we’ve selected a few weasyprint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kozea / WeasyPrint / weasyprint / css / validation / properties.py View on Github external
@single_keyword
def clear(keyword):
    """``clear`` property validation."""
    return keyword in ('left', 'right', 'both', 'none')
github Kozea / WeasyPrint / weasyprint / css / validation / properties.py View on Github external
@single_keyword
def caption_side(keyword):
    """``caption-side`` properties validation."""
    return keyword in ('top', 'bottom')
github Kozea / WeasyPrint / weasyprint / css / validation / properties.py View on Github external
@single_keyword
def text_decoration_style(keyword):
    """``text-decoration-style`` property validation."""
    if keyword in ('solid', 'double', 'dotted', 'dashed', 'wavy'):
        return keyword
github Kozea / WeasyPrint / weasyprint / css / validation / properties.py View on Github external
@single_keyword
def table_layout(keyword):
    """Validation for the ``table-layout`` property"""
    if keyword in ('fixed', 'auto'):
        return keyword
github Kozea / WeasyPrint / weasyprint / css / validation / properties.py View on Github external
@single_keyword
def text_align(keyword):
    """``text-align`` property validation."""
    return keyword in ('left', 'right', 'center', 'justify')
github Kozea / WeasyPrint / weasyprint / css / validation / properties.py View on Github external
@single_keyword
def text_transform(keyword):
    """``text-align`` property validation."""
    return keyword in (
        'none', 'uppercase', 'lowercase', 'capitalize', 'full-width')
github Kozea / WeasyPrint / weasyprint / css / validation / properties.py View on Github external
@single_keyword
def image_rendering(keyword):
    """Validation for ``image-rendering``."""
    return keyword in ('auto', 'crisp-edges', 'pixelated')
github Kozea / WeasyPrint / weasyprint / css / validation / properties.py View on Github external
@single_keyword
def font_variant_caps(keyword):
    return keyword in (
        'normal', 'small-caps', 'all-small-caps', 'petite-caps',
        'all-petite-caps', 'unicase', 'titling-caps')
github Kozea / WeasyPrint / weasyprint / css / validation / properties.py View on Github external
@single_keyword
def box_decoration_break(keyword):
    """``box-decoration-break`` property validation."""
    return keyword in ('slice', 'clone')
github Kozea / WeasyPrint / weasyprint / css / validation / properties.py View on Github external
@single_keyword
def border_style(keyword):
    """``border-*-style`` properties validation."""
    return keyword in ('none', 'hidden', 'dotted', 'dashed', 'double',
                       'inset', 'outset', 'groove', 'ridge', 'solid')