Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: support tailwind.css external resourses for Sandpack#8647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
theshadowagent wants to merge1 commit intocodesandbox:master
base:master
Choose a base branch
Loading
fromrorkai:feat/tailwindcss-external-styles

Conversation

theshadowagent
Copy link

@theshadowagenttheshadowagent commentedOct 31, 2024
edited
Loading

Complete Tailwind CSS Play CDN support in Sandpack Bundler

What kind of change does this PR introduce?

Adds complete support for Tailwind CSS Play CDN in Sandpack by properly handling custom Tailwind CSS configs.

What is the current behavior?

Currently, when importing Tailwind Play CDN viaexternalResources in Sandpack it is impossible to customize Tailwindglobals.css config because Sandpack bundler doesn't set the expectedtype="text/tailwindcss" attribute of the<style>/` tags. This prevents the Tailwind Play CDN (https://cdn.tailwindcss.com) from compiling CSS with custom Tailwind config.

What is the new behavior?

The Sandbox bundler now correctly identifies Tailwind CSS external resourses and sets the expectedtype="text/tailwindcss" attribute when the external resource file name includes'tailwind.css'.

This enables:

  • Using customglobals.tailwind.css viaexternalResources
  • Using customtailwind.config.js viaexternalResources

Steps to test

  1. Create a new project with Sandpack's. Passhttps://cdn.tailwindcss.com in Sandpack'sexternalResources
  2. Pass customtailwind.config.js file to Sandpack'sexternalResources
  3. Passglobals.tailwind.css to Sandpack'sexternalResources with custom TailwindCSS styles (same asglobals.css in standard Tailwind projects)
  4. Verify that TailwindCSS is loaded properly in Sandpack
  5. Verify that custom Tailwind styles work as expected

Checklist

  • Documentation
  • Testing
  • Ready to be merged
  • Added myself to contributors table (N/A)

Additional Context

This feature is for developers who want to use Tailwind CSS in Sandpack with customtailwind.config.js and customglobals.css. The Tailwind Play CDN requirestype="text/tailwindcss" in<link>/<style> tags to support customglobals.css files, which this PR now supports.

Tailwind CDN docs:https://tailwindcss.com/docs/installation/play-cdn

@codesandboxCodeSandbox
Copy link

Review or Edit in CodeSandbox

Open the branch inWeb EditorVS CodeInsiders

OpenPreview

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@theshadowagent

[8]ページ先頭

©2009-2025 Movatter.jp