I've been trying to understand the algorithm for selector-extend() and have a question.
Input:
a {
foo: selector-extend('a.foo.baz', '.foo', '.baz');
}
Output:
a {
foo: a.foo.baz, a.baz;
}
This makes sense so far. For the second output selector, .foo was replaced with .baz, and was then removed because it is a duplicate class name. However, when a placeholder selector appears in the first argument, the situation changes:
Input:
a {
foo: selector-extend('%a.foo.baz', '.foo', '.baz');
}
Output:
Now the original selector is not being included in the output. Indeed "%a.foo.baz" is a superselector of "%a.baz" and it makes sense to remove it. But could someone please explain why this unification only happened when a placeholder selector appeared in the input, and not otherwise?