Skip to content

Migrate translate utilities to Tailwind

Paul Gascou-Vaillancourt requested to merge 456636-tailwind-translate into master

What does this MR do and why?

Migrates gl-translate-x-n50 to -gl-translate-x-1/2 and gl-translate-y-n50 to -gl-translate-y-1/2.

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

User profile busy badge
Screenshot_2024-04-17_at_2.19.40_PM
Wiki sidebar (mouse over link)
Screenshot_2024-04-17_at_2.27.24_PM

How to set up and validate locally

  1. -gl-translate-x-1/2

    1. Set your status to Busy.
    2. Navigate to your profile page.
    3. Observe that the Busy badge is properly positioned below your avatar.
  2. -gl-translate-y-1/2

    1. Navigate to a Wiki page.
    2. Place the mouse cursor over a link in the right navbar.
    3. Observe that the + icon is properly positioned.
  3. CSS-in-Js

    1. Run the following script to produce a diff for the CSS-in-Js config:
    git checkout master
    rm config/helpers/tailwind/css_in_js.js && yarn tailwindcss:build
    git add --force config/helpers/tailwind/css_in_js.js
    git checkout 456636-tailwind-translate
    rm config/helpers/tailwind/css_in_js.js && yarn tailwindcss:build
    git diff config/helpers/tailwind/css_in_js.js
    1. This should cause the translate-x-n50 and translate-y-n50 utils to be dropped from the config. translate-y-n100 is still there because it's used in GitLab UI.
    diff --git a/config/helpers/tailwind/css_in_js.js b/config/helpers/tailwind/css_in_js.js
    index 5acd7badd749..30ab0e1f8bad 100644
    --- a/config/helpers/tailwind/css_in_js.js
    +++ b/config/helpers/tailwind/css_in_js.js
    @@ -1,5 +1,5 @@
     /**
    - * The following 640 definitions need to be migrated to Tailwind.
    + * The following 638 definitions need to be migrated to Tailwind.
      * Let's do this! 🚀
      */
     module.exports = {
    @@ -699,8 +699,6 @@ module.exports = {
         'max-width': '82%',
       },
       '.text-truncate': { overflow: 'hidden', 'text-overflow': 'ellipsis', 'white-space': 'nowrap' },
    -  '.translate-x-n50': { transform: 'translateX(-50%)' },
    -  '.translate-y-n50': { transform: 'translateY(-50%)' },
       '.translate-y-n100': { transform: 'translateY(-100%)' },
       '.transition-property-stroke': { 'transition-property': 'stroke' },
       '.transition-property-stroke-opacity': { 'transition-property': 'stroke-opacity' },

Related to #456636 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports