You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
(I know the template says compilation error should go and open issue in libsass, but this problem is only happening in node-sass, and does not occur in sassmeister even if libsass is selected as the compiler, so I believe the issue lies in node-sass)
The problem apparently has to do with :nth-child, @extend and the magic number n+4 (huh but yes)
Following is the code that will result in the wrong result. For context, this is sort of a polyfill for CSS grid on IE that simulates column gap, row gap, and cell auto-placement. Column gap is done with empty column, row gap with cell's margin-top, and cell placement with @for loop. (There is a more minimal example below)
Problem
(I know the template says compilation error should go and open issue in libsass, but this problem is only happening in node-sass, and does not occur in sassmeister even if libsass is selected as the compiler, so I believe the issue lies in node-sass)
The problem apparently has to do with
:nth-child
,@extend
and the magic number n+4 (huh but yes)Following is the code that will result in the wrong result. For context, this is sort of a polyfill for CSS grid on IE that simulates column gap, row gap, and cell auto-placement. Column gap is done with empty column, row gap with cell's margin-top, and cell placement with @for loop. (There is a more minimal example below)
This will produce the following CSS:
As seen,
:nth-child(2)
is mistakenly rendered as:nth-child(n+ 4)
, same also happens for 25 and 44, which is replaced with n+4.Here are some tests that I have done that give a slightest hint:
@extend
is very likely the culprit, if I remove the.x {}
block and change%ie-grid
to.ie-grid
, everything renders as normal.%ie-grid
to.ie-grid
and update the@extend %ie-grid
to@extend .ie-grid
, both of them will inherit the n+4 weirdness.Below is a further trim down of the above example, but I am not sure if this covers the whole issue though.
Renders:
Environment
npm -v
): 6.14.5node -v
): v12.18.2node -p process.versions
):{ node: '12.18.2', v8: '7.8.279.23-node.39', uv: '1.38.0', zlib: '1.2.11', brotli: '1.0.7', ares: '1.16.0', modules: '72', nghttp2: '1.41.0', napi: '6', llhttp: '2.0.4', http_parser: '2.9.3', openssl: '1.1.1g', cldr: '37.0', icu: '67.1', tz: '2019c', unicode: '13.0' }
node -p process.platform
): win32node -p process.arch
): x64node -p "require('node-sass').info"
):npm ls node-sass
):The text was updated successfully, but these errors were encountered: