Skip to content

refactor(Markdown): replace Sass with plain CSS and Tailwind @apply#8156

Merged
alexander-akait merged 3 commits intowebpack:mainfrom
sujalgoel:refactor/markdown-scss-to-css
Apr 3, 2026
Merged

refactor(Markdown): replace Sass with plain CSS and Tailwind @apply#8156
alexander-akait merged 3 commits intowebpack:mainfrom
sujalgoel:refactor/markdown-scss-to-css

Conversation

@sujalgoel
Copy link
Copy Markdown
Contributor

Summary

Part of #8047. Converts Markdown.scss and prism-theme.scss to plain CSS, removing the Sass dependency from this component.

  • Replaced Markdown.scss with Markdown.css using @apply for Tailwind utilities
  • Replaced prism-theme.scss with prism-theme.css (no Tailwind needed here)
  • Added @reference "tailwindcss" at the top of Markdown.css for Tailwind v4 @apply support
  • Inlined all getFontSize() and getColor() calls as computed values
  • Resolved all color.adjust() calls to their hex/rgba equivalents
  • Replaced @include break with @media (min-width: 768px)
  • Updated Markdown.jsx to import .css instead of .scss

All styles are visually identical to the original.

What kind of change does this PR introduce?

Refactor. No behavior or visual changes.

Did you add tests for your changes?

No.

Does this PR introduce a breaking change?

No.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

N/A

Use of AI

No.

Removes Sass dependencies from Markdown.scss and prism-theme.scss.
Converted to plain CSS files with @apply for Tailwind utilities.
Inlined all Sass variables, functions (getFontSize, getColor), and
color.adjust() calls as computed values. Replaced @include break
with plain @media (min-width: 768px). Added @reference directive
for Tailwind v4 @apply support.

Part of webpack#8047.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment Apr 2, 2026 11:26pm

Request Review

Copy link
Copy Markdown
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use colors, width, height, padding and etc from tailwind too, we have options for this, so keeping hardcoded values are bad

Comment thread src/components/Markdown/Markdown.css Outdated
}
h6 {
font-size: 13.331px;
@apply text-[13.331px];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where we get such values? For me they are looking very weird

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They come from the original Markdown.scss, which had a getFontSize() Sass helper using a modular type scale (ratio 1.2, base 16px). So 16 * 1.2^4 = 33.178px for h1, 16 * 1.2^3 = 27.648px for h2, etc. I just inlined the computed values when removing Sass. If you want to round them or switch to a different scale, I can do that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use different values, better to use rem

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to Tailwind's built-in text scale: text-4xl (2.25rem) down to text-sm (0.875rem). No more arbitrary values.

@alexander-akait alexander-akait merged commit d2a9852 into webpack:main Apr 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants