Skip to content

Missing CSS property: overflow-wrap #78

Description

@rushikeshiam

Description

overflow-wrap is not in the known properties list, causing the following warning:

Property: Unknown Property name. [overflow-wrap]

Background

overflow-wrap was standardized in CSS Text Module Level 3 as the official
replacement for the IE-era word-wrap property. It has been supported in all
major browsers since 2017 and is defined here:
https://www.w3.org/TR/css-text-3/#overflow-wrap-property

Suggested Fix

Add overflow-wrap to the CSS Text Level 3 profile in cssutils/profiles.py:

# CSS Text Level 3
properties[Profiles.CSS3_TEXT] = {
    ...
    'overflow-wrap': 'normal|break-word|anywhere|inherit|initial|unset',
    'word-wrap':     'normal|break-word|inherit|initial|unset',  # legacy alias
}

Workaround

Users can currently work around this by manually registering the property:

import cssutils
cssutils.profile.addProfile(
    'overflow-wrap support',
    {'overflow-wrap': 'normal|break-word|anywhere|inherit|initial|unset'},
    {}
)

Environment

  • cssutils version: 2.15.0
  • Python version: 3.x

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions