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
Css attr error from "postcss-gap" plugin #85
Comments
Hi @frugan-it. Hmm, this is an odd one. I can't recreate the issue when I create an example repo with This is my module.exports = {
// ...
module: {
rules: [
{
test: /\.css$/i,
include: path.resolve(__dirname, 'src'),
use: ['style-loader', 'css-loader', 'postcss-loader'],
},
],
},
} Can you provide a repo so I can test? As far as I know, the plugin shouldn't be doing anything to the property |
Hi @gavinmcfarland, thanks for the support! I created this test repository https://github.com/frugan-it/flex-gap-polyfill-issue-85. |
Thank you! I'll check it out and do some investigating. |
So, I've looked into it a bit more. There is a conflict between
You can try the following to work around it. Tell img[width][height]{
/* added by fgp */
height: auto;
aspect-ratio: attr(width) / attr(height);
} Or you can manually apply the polyfill: img[width][height]{
/* added by fgp */
--fgp-height: var(--element-has-fgp) calc(auto + var(--fgp-gap-row, 0%));
height: var(--fgp-height, auto);
aspect-ratio: attr(width, 1) / attr(height, 1);
} I tried to disable the modification that Sass applies but it seems a little unpredictable. I found some others have had difficulty with it too. webpack-contrib/sass-loader#763 Let me know how you get on. |
I can probably also release a fix by adding some logic to avoid reading the values like the ones in the |
Thanks @gavinmcfarland, sorry for the late reply.. I didn't know you could tell |
No worries. I initially never saw the need to ignore certain rules, but I remembered the plugin ignores rules it's already processed, which have a comment of |
Hi there,
I'm having this error with Webpack 5:
These are the main parts of my setup:
package.json
webpack.config.js
main.scss
The error appears only when I enable your plugin, and with the plugin enabled it disappears only by commenting the line
aspect-ratio: attr(width) / attr(height);
of the scss file.What could it depend on?
The text was updated successfully, but these errors were encountered: