Add support for letter-spacing in typography settings

Created on 27 February 2025, 10 days ago

Problem
Currently, the Artisan module allows customization of typography properties like font-size, font-weight, and line-height, but does not support the letter-spacing property. This limits the ability to adjust text spacing directly from the UI.

Solution Implemented

  • Added letter-spacing as a configurable option in ArtisanCustomizations.php within getDefaultDefinition().
  • Introduced the CSS variable --theme-letter-spacing in getAttachmentStyles() so it can be dynamically applied.
  • Updated SCSS files (_typography.scss, _body.scss, _headings.scss, _forms.scss) to use var(--theme-letter-spacing, normal); ensuring consistent application across all text elements.

Testing Conducted
Letter-spacing configuration

  • Tested with different values such as 1px, 2px, and 0.5em through the UI.
  • Verified that --theme-letter-spacing was correctly generated in the CSS.
  • Checked that letter-spacing is applied to body, headings (h1-h6), paragraphs (p), and links (a).
Feature request
Status

Needs review

Version

1.3

Component

Code

Created by

🇪🇸Spain msark

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024