PostCSS layout helpers inconsistency

Created on 13 July 2023, over 1 year ago
Updated 10 November 2023, about 1 year ago

Problem/Motivation

In the Olivero theme, there is an inconsistency in the use of spacing variables or layout helpers in the PostCSS files. While variables.pcss.css defines spacing variables like --sp1, --sp2, --sp3, etc., based on the variable --sp.

there are instances in some pcss files where values are directly assigned the `calc(2 * var(--sp));` value instead of using the equivalent --sp2. This inconsistency occurs for different versions of the layout helpers across several PCSS files.

I am mentioning --sp2 as an example but the situation is with different version of the layout helpers.

There are also instances of similar formulas, without a variable. In the spirit of standardization, we should add those to the variables.pcss and change the few occurrences.

Steps to reproduce

1. Open the PostCSS files in the Olivero theme.
2. Check for occurrences of the full formula instead of the corresponding variable.

Example in file core/themes/olivero/css/components/header-search-narrow.css line 47:

height: calc(3 * var(--sp));

Proposed resolution

To maintain consistency and readability, all instances of `calc([number] * var(--sp));` should be replaced with the equivalent --sp[number]. The same applies to other versions of the layout helpers. This will ensure that the usage of spacing variables is consistent across all PCSS files in the Olivero theme.

Test pages

The changes should be reflected in all pcss files of the Olivero theme.

Before/After screenshots

Screenshots are not applicable for this issue as it's a code consistency issue.

Markup changes

The markup changes involve replacing instances of `calc(2 * var(--sp));` with --sp2 (and similar replacements for other versions of the layout helpers) in the relevant PCSS files.

Cross browser tests

Cross-browser testing is not applicable for this issue as it's a code consistency issue.

Related Issues

No related issues.

๐Ÿ“Œ Task
Status

Fixed

Version

10.1 โœจ

Component
Oliveroย  โ†’

Last updated about 17 hours ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States camoa

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

Comments & Activities

Production build 0.71.5 2024