Skip to content

Commit

Permalink
Add line height property
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca committed Apr 27, 2020
1 parent abebfff commit 532a147
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
2 changes: 2 additions & 0 deletions colosseum/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ def value(self, context):
# 10.8 Leading and half-leading
######################################################################
# line_height
LINE_HEIGHT_CHOICES = Choices(NORMAL, validators=[is_number, is_length, is_percentage], explicit_defaulting_constants=[INHERIT])

# vertical_align

######################################################################
Expand Down
29 changes: 15 additions & 14 deletions colosseum/declaration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from . import engine as css_engine
from . import parser
from . import engine as css_engine, parser
from .constants import ( # noqa
ALIGN_CONTENT_CHOICES, ALIGN_ITEMS_CHOICES, ALIGN_SELF_CHOICES, AUTO,
BACKGROUND_COLOR_CHOICES, BORDER_COLLAPSE_CHOICES, BORDER_COLOR_CHOICES,
Expand All @@ -11,20 +10,22 @@
GRID_AUTO_CHOICES, GRID_AUTO_FLOW_CHOICES, GRID_GAP_CHOICES,
GRID_PLACEMENT_CHOICES, GRID_TEMPLATE_AREA_CHOICES, GRID_TEMPLATE_CHOICES,
INITIAL, INLINE, INVERT, JUSTIFY_CONTENT_CHOICES, LETTER_SPACING_CHOICES,
LTR, MARGIN_CHOICES, MAX_SIZE_CHOICES, MEDIUM, MIN_SIZE_CHOICES, NORMAL,
NOWRAP, ORDER_CHOICES, ORPHANS_CHOICES, OUTLINE_COLOR_CHOICES,
OUTLINE_STYLE_CHOICES, OUTLINE_WIDTH_CHOICES, OVERFLOW_CHOICES,
PADDING_CHOICES, PAGE_BREAK_AFTER_CHOICES, PAGE_BREAK_BEFORE_CHOICES,
PAGE_BREAK_INSIDE_CHOICES, POSITION_CHOICES, QUOTES_CHOICES, ROW,
SEPARATE, SHOW, SIZE_CHOICES, STATIC, STRETCH, TABLE_LAYOUT_CHOICES,
TEXT_ALIGN_CHOICES, TEXT_DECORATION_CHOICES, TEXT_INDENT_CHOICES,
TEXT_TRANSFORM_CHOICES, TOP, TRANSPARENT, UNICODE_BIDI_CHOICES,
VISIBILITY_CHOICES, VISIBLE, WHITE_SPACE_CHOICES, WIDOWS_CHOICES,
WORD_SPACING_CHOICES, Z_INDEX_CHOICES, OtherProperty,
LINE_HEIGHT_CHOICES, LTR, MARGIN_CHOICES, MAX_SIZE_CHOICES, MEDIUM,
MIN_SIZE_CHOICES, NORMAL, NOWRAP, ORDER_CHOICES, ORPHANS_CHOICES,
OUTLINE_COLOR_CHOICES, OUTLINE_STYLE_CHOICES, OUTLINE_WIDTH_CHOICES,
OVERFLOW_CHOICES, PADDING_CHOICES, PAGE_BREAK_AFTER_CHOICES,
PAGE_BREAK_BEFORE_CHOICES, PAGE_BREAK_INSIDE_CHOICES, POSITION_CHOICES,
QUOTES_CHOICES, ROW, SEPARATE, SHOW, SIZE_CHOICES, STATIC, STRETCH,
TABLE_LAYOUT_CHOICES, TEXT_ALIGN_CHOICES, TEXT_DECORATION_CHOICES,
TEXT_INDENT_CHOICES, TEXT_TRANSFORM_CHOICES, TOP, TRANSPARENT,
UNICODE_BIDI_CHOICES, VISIBILITY_CHOICES, VISIBLE, WHITE_SPACE_CHOICES,
WIDOWS_CHOICES, WORD_SPACING_CHOICES, Z_INDEX_CHOICES, OtherProperty,
TextAlignInitialValue, default,
)
from .exceptions import ValidationError
from .wrappers import Border, BorderBottom, BorderLeft, BorderRight, BorderTop, Outline
from .wrappers import (
Border, BorderBottom, BorderLeft, BorderRight, BorderTop, Outline,
)

_CSS_PROPERTIES = set()

Expand Down Expand Up @@ -304,7 +305,7 @@ def __init__(self, **style):
max_height = validated_property('max_height', choices=MAX_SIZE_CHOICES, initial=None)

# 10.8 Leading and half-leading
# line_height
line_height = validated_property('line_height', choices=LINE_HEIGHT_CHOICES, initial=NORMAL)
# vertical_align

# 11. Visual effects #################################################
Expand Down

0 comments on commit 532a147

Please sign in to comment.