Fix spacing issue due to Tailwind conflict
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:
- Migrate these to the legacy util
gl-column-gap-*
except for !150608 (comment 1877941280) (this MR) - Remove them from src/scss/utility-mixins/spacing.scss#L867
- Migrate all the
gl-column-gap-*
utilities togl-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 |
---|---|
![]() |
![]() |
Organization projects
Before | After |
---|---|
![]() |
![]() |
Pipeline Graph (Downstream Column / Linked Pipelines Column)
Before | After |
---|---|
![]() |
![]() |
Releases
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
- Enable the feature flag
echo "Feature.enable(:ui_for_organizations)" | gdk rails c
- Navigate to
/-/organizations/default/groups_and_projects
Edited by Peter Hegman