Skip to content
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

Add specs for unifying :host and :host-context #1700

Merged
merged 3 commits into from
Sep 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
274 changes: 274 additions & 0 deletions spec/core_functions/selector/unify/simple/pseudo.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,277 @@ a {b: selector-unify(":matches(.c)", ":matches(.d)")}
a {
b: :matches(.c):matches(.d);
}

<===>
================================================================================
<===> host/options.yml
---
:ignore_for:
- libsass

<===>
================================================================================
<===> host/argless/host/argless/input.scss
a {b: selector-unify(":host", ":host")}

<===> host/argless/host/argless/output.css
a {
b: :host;
}

<===>
================================================================================
<===> host/argless/host/arg/input.scss
a {b: selector-unify(":host", ":host(.c)")}

<===> host/argless/host/arg/output.css
a {
b: :host:host(.c);
}

<===>
================================================================================
<===> host/argless/host_context/left/input.scss
a {b: selector-unify(":host", ":host-context(.c)")}

<===> host/argless/host_context/left/output.css
a {
b: :host:host-context(.c);
}

<===>
================================================================================
<===> host/argless/host_context/right/input.scss
a {b: selector-unify(":host-context(.c)", ":host")}

<===> host/argless/host_context/right/output.css
a {
b: :host-context(.c):host;
}

<===>
================================================================================
<===> host/argless/selector_pseudo/left/input.scss
a {b: selector-unify(":host", ":is(.c)")}

<===> host/argless/selector_pseudo/left/output.css
a {
b: :is(.c):host;
}

<===>
================================================================================
<===> host/argless/selector_pseudo/right/input.scss
a {b: selector-unify(":is(.c)", ":host")}

<===> host/argless/selector_pseudo/right/output.css
a {
b: :is(.c):host;
}

<===>
================================================================================
<===> host/argless/pseudo/left/input.scss
a {b: inspect(selector-unify(":host", ":hover"))}

<===> host/argless/pseudo/left/output.css
a {
b: null;
}

<===>
================================================================================
<===> host/argless/pseudo/right/input.scss
a {b: inspect(selector-unify(":hover", ":host"))}

<===> host/argless/pseudo/right/output.css
a {
b: null;
}

<===>
================================================================================
<===> host/argless/class/left/input.scss
a {b: inspect(selector-unify(":host", ".c"))}

<===> host/argless/class/left/output.css
a {
b: null;
}

<===>
================================================================================
<===> host/argless/class/right/input.scss
a {b: inspect(selector-unify(".c", ":host"))}

<===> host/argless/class/right/output.css
a {
b: null;
}

<===>
================================================================================
<===> host/argless/universal/left/input.scss
a {b: inspect(selector-unify(":host", "*"))}

<===> host/argless/universal/left/output.css
a {
b: null;
}

<===>
================================================================================
<===> host/argless/universal/right/input.scss
a {b: inspect(selector-unify("*", ":host"))}

<===> host/argless/universal/right/output.css
a {
b: null;
}

<===>
================================================================================
<===> host/argless/compound/selector_pseudos/left/input.scss
a {b: selector-unify(":host", ":is(.c):is(.d)")}

<===> host/argless/compound/selector_pseudos/left/output.css
a {
b: :is(.c):host:is(.d);
}

<===>
================================================================================
<===> host/argless/compound/selector_pseudos/right/input.scss
a {b: selector-unify(":is(.c):is(.d)", ":host")}

<===> host/argless/compound/selector_pseudos/right/output.css
a {
b: :is(.c):is(.d):host;
}

<===>
================================================================================
<===> host/argless/compound/class_and_selector_pseudo/left/input.scss
a {b: inspect(selector-unify(":host", ".c:is(.d)"))}

<===> host/argless/compound/class_and_selector_pseudo/left/output.css
a {
b: null;
}

<===>
================================================================================
<===> host/argless/compound/class_and_selector_pseudo/right/input.scss
a {b: inspect(selector-unify(".c:is(.d)", ":host"))}

<===> host/argless/compound/class_and_selector_pseudo/right/output.css
a {
b: null;
}

<===>
================================================================================
<===> host/argless/compound/host_and_class/left/input.scss
a {b: inspect(selector-unify(":host", ":host.c"))}

<===> host/argless/compound/host_and_class/left/output.css
a {
b: null;
}

<===>
================================================================================
<===> host/argless/compound/host_and_class/right/input.scss
a {b: inspect(selector-unify(":host.c", ":host"))}

<===> host/argless/compound/host_and_class/right/output.css
a {
b: null;
}

<===>
================================================================================
<===> host/arg/preserved/left/input.scss
a {b: selector-unify(":host(.c)", ":is(.d)")}

<===> host/arg/preserved/left/output.css
a {
b: :is(.d):host(.c);
}

<===>
================================================================================
<===> host/arg/preserved/right/input.scss
a {b: selector-unify(":is(.c)", ":host(.d)")}

<===> host/arg/preserved/right/output.css
a {
b: :is(.c):host(.d);
}

<===>
================================================================================
<===> host/arg/removed/left/input.scss
a {b: inspect(selector-unify(":host(.c)", ".d"))}

<===> host/arg/removed/left/output.css
a {
b: null;
}

<===>
================================================================================
<===> host/arg/removed/right/input.scss
a {b: inspect(selector-unify(".c", ":host(.d)"))}

<===> host/arg/removed/right/output.css
a {
b: null;
}

<===>
================================================================================
<===> host_context/options.yml
---
:ignore_for:
- libsass

<===>
================================================================================
<===> host_context/preserved/left/input.scss
a {b: selector-unify(":host-context(.c)", ":is(.d)")}

<===> host_context/preserved/left/output.css
a {
b: :is(.d):host-context(.c);
}

<===>
================================================================================
<===> host_context/preserved/right/input.scss
a {b: selector-unify(":is(.c)", ":host-context(.d)")}

<===> host_context/preserved/right/output.css
a {
b: :is(.c):host-context(.d);
}

<===>
================================================================================
<===> host_context/removed/left/input.scss
a {b: inspect(selector-unify(":host-context(.c)", ".d"))}

<===> host_context/removed/left/output.css
a {
b: null;
}

<===>
================================================================================
<===> host_context/removed/right/input.scss
a {b: inspect(selector-unify(".c", ":host-context(.d)"))}

<===> host_context/removed/right/output.css
a {
b: null;
}