Skip to content

Error "Array to String conversion" when handling pseudo + attribute selector #606

@ikkez

Description

@ikkez

I tried to compile the latest uikit version but it fails hard with an error.

Problem is this type of selector:

:where([class*='foo']) p {
 // ...
}

To be more precise it's this at transition.scss:

:where(.uk-transition-fade),
:where([class*='uk-transition-scale']),
:where([class*='uk-transition-slide']) {
    --uk-position-translate-x: 0;
    --uk-position-translate-y: 0;
}

https://github.com/uikit/uikit/blob/87801983205aa9bb81a122c4e0f1b96b5117c169/src/scss/components/transition.scss#L51-L56

The error happens at array_diff which compares two incompatible nested array structures I guess:

scssphp/src/Compiler.php

Lines 773 to 780 in c54b0a3

// if the new part is just including a previous part don't try to extend anymore
if (\count($part) > 1) {
foreach ($partsPile as $previousPart) {
if (! \count(array_diff($previousPart, $part))) {
continue 2;
}
}
}

Debug:

Bildschirmfoto 2022-08-15 um 22 30 33

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions