style-inject
is used by rollup-plugin-postcss
and many other packages. When used in these packages there is an issue with insertAt
behavior.
Given the following imports
// A.js
import B from './B';
import styles from './a.css';
...
// B.js
import styles from './b.css'`
...
Without insertAt: 'top'
the resulting injected styles are
<style>
// contents of b.css
</style>
<style>
// contents of a.css
</style>
With insertAt: 'top'
the resulting injected styles are
<style>
// contents of a.css
</style>
<style>
// contents of b.css
</style>
This is incorrect as a's styles were imported after b, so should override the styles from b naturally by being imported second.
What this plugin really needs in an option to preserve the order of stylesheets relative to each other but still insert them at the beginning of the head
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too