Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Export separate CSS file in Vue SDK #131

Merged
merged 3 commits into from
Nov 27, 2023
Merged

Conversation

a11rew
Copy link
Collaborator

@a11rew a11rew commented Nov 27, 2023

Issue

In an attempt to make it easier to use the Vue SDK, we inlined the import of css files used in the SDK so an extra import was not required.

This kind of worked, but has consistently caused problems on Nuxt:

  1. Having to add transpilation of the SDK to support the css import in JS
  2. Having to add the import transform config option, which was only needed in the monorepo in addition
  3. Most recently, the package not working when used with NPM because NPM's nested dependency node_modules structure meant the transpiled package could not resolve its dependencies

This PR removes the CSS inlining in favor of exporting a CSS file to be imported. This allows the package to be used in Vue environments without a build step (browser usage) as well as without framework specific workarounds. Requiring the CSS import is also consistent with what existing Vue component libraries ask you to do and so is not an unreasonable change, ref: Quasar, FloatingVue, PrimeVue

Changes

  • Adds a components/style.css export to the Vue SDK. This file contains the styles necessary to correctly render the exported components and as such must be imported when a Vue component the SDK provides is used.
  • Removes custom esbuild plugin that inlined the css imports
  • Removes nuxt.config options added to the starters to support inlined css that are no longer necessary
  • Updates package documentation with instructions on using the exported css file.

@a11rew a11rew requested review from kevinstubbs and aumkar November 27, 2023 14:12
@a11rew a11rew merged commit 5a8269f into main Nov 27, 2023
4 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