Skip to content

Conversation

@t27duck
Copy link
Contributor

@t27duck t27duck commented Apr 11, 2021

The content style for attachments where a "bullet" character was being
injected before the element's content was causing the compiled CSS to
shove an extra @charset "UTF-8"; in the middle of the file (line
~300). This can cause warnings and possibly errors for CSS build
systems.

For example, this warning is emitted from postcss-loader when importing
the Trix CSS in webpack...

Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning
(300:1) postcss-import: @charset must precede all other statements

I changed the style to use an escaped unicode version of a bullet
instead of the actual character. After running bin/blade build
locally, the extra @charset no longer showed up in the compiled file.

Fixes #795

The content style for atttachments where a "bullet" character was being
injected before the element's content was causing the compiled CSS to
shove an extra `@charset "UTF-8";` in the middle of the file (line
~300). This can cause warnings and possibly errors for CSS build
systems.

For example, this warning is emited from `postcss-loader` when importing
the Trix CSS in webpack...

```
Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning
(300:1) postcss-import: @charset must precede all other statements
```

I changed the style to use an escaped unicode version of a bullet
instead of the actual character. After running `bin/blade build`
locally, the extra `@charset` no longer showed up in the compiled file.
@stale
Copy link

stale bot commented Jul 21, 2021

This pull request has been automatically marked as stale after 90 days of inactivity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jul 21, 2021
@stale stale bot removed the stale label Jul 21, 2021
@danharrin
Copy link

Hi Basecamp team, this fixes an issue I'm having when compiling Trix CSS with Webpack. Could you review and merge it please?

@dhh dhh merged commit b014fd1 into basecamp:main Sep 27, 2021
Eric-Guo pushed a commit to Eric-Guo/trix that referenced this pull request Oct 30, 2021
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.

Double @charset "UTF-8";

3 participants