Skip to content

Fix spacing issue due to Tailwind conflict

Peter Hegman requested to merge fix-gl-gap-x-issue into master

What does this MR do and why?

I noticed a minor issue due to a conflict between our legacy CSS utility classes and Tailwind utility classes. There are a few places where we use gl-gap-x-* or gl-gap-y-*. In these look like:

'.gap-x-3 > * + *': { 'margin-left': '0.5rem' },
'.gap-x-5 > * + *': { 'margin-left': '1rem' },
'.gap-y-3 > * + *': { 'margin-top': '0.5rem' },

But in Tailwind these utilities use column-gap or row-gap. This means if the element also has display: flex then there is duplicate gap. Here's how we will fix this:

  1. Migrate these to the legacy util gl-column-gap-* except for !150608 (comment 1877941280) (this MR)
  2. Remove them from src/scss/utility-mixins/spacing.scss#L867
  3. Migrate all the gl-column-gap-* utilities to gl-gap-x-*

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

css_in_js.js diff

diff --git a/config/helpers/tailwind/css_in_js.js b/config/helpers/tailwind/css_in_js.js
index 8f7e7c943a4b..1b82df306809 100644
--- a/config/helpers/tailwind/css_in_js.js
+++ b/config/helpers/tailwind/css_in_js.js
@@ -1,5 +1,5 @@
 /**
- * The following 632 definitions need to be migrated to Tailwind.
+ * The following 629 definitions need to be migrated to Tailwind.
  * Let's do this! 🚀
  */
 module.exports = {
@@ -574,9 +574,6 @@ module.exports = {
   '.my-n4': { 'margin-top': '-0.75rem', 'margin-bottom': '-0.75rem' },
   '.mx-n4': { 'margin-left': '-0.75rem', 'margin-right': '-0.75rem' },
   '.mx-n5': { 'margin-left': '-1rem', 'margin-right': '-1rem' },
-  '.gap-x-3 > * + *': { 'margin-left': '0.5rem' },
-  '.gap-x-5 > * + *': { 'margin-left': '1rem' },
-  '.gap-y-3 > * + *': { 'margin-top': '0.5rem' },
   '.sm-gap-3': { '@media (min-width: 576px)': { gap: '0.5rem' } },
   '.column-gap-2': { 'column-gap': '0.25rem' },
   '.column-gap-3': { 'column-gap': '0.5rem' },

Organization groups

Before After
Screenshot_2024-04-23_at_9.12.13_PM Screenshot_2024-04-23_at_8.48.03_PM

Organization projects

Before After
Screenshot_2024-04-23_at_9.11.56_PM Screenshot_2024-04-23_at_8.48.51_PM

Pipeline Graph (Downstream Column / Linked Pipelines Column)

Before After
Screenshot_2024-04-24_at_18.00.36 Screenshot_2024-04-24_at_18.01.20

Releases

Before After
Screenshot_2024-04-24_at_7.49.47_AM Screenshot_2024-04-24_at_7.30.19_AM

How to set up and validate locally

  1. Enable the feature flag
    • echo "Feature.enable(:ui_for_organizations)" | gdk rails c
  2. Navigate to /-/organizations/default/groups_and_projects
Edited by Peter Hegman

Merge request reports