Skip to content

[css-text] Enable finer control over text-justify #7738

@scottkellum

Description

@scottkellum

css-text#text-justify-property

Currently there is little control over justification settings in CSS. This often results in egregious rivers when text is justified. While there is some control with the text-justify property, it lacks necessary control to adequately fine tune justification.

Design programs like Adobe InDesign allow for nuanced control of 3 characteristics: word spacing, letter spacing, and font stretch. The current keywords only allow for word spacing and letter spacing to be turned on or off, with no support for font stretch.

Proposal

Allow a series of numbers to be passed into text-justify to choose what text characteristics are altered by the justification algorithm. text-justify: 1 0 0 would be the same as inter-word and text-justify: 0 1 0 would be the same as inter-character. You could change this setting to text-justify: 1 1 0 to evenly distribute the extra space to both word spacing and letter spacing, or text-justify: 1 1 1 to include font-stretch as well. Additionally, proportions could be changed by adjusting the values. text-justify: 2 1 0 would mean twice as much of the extra space would be distributed to word spacing as letter spacing.

Related resources:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions