diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-10-01 13:19:35 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-01 13:19:35 +0800 |
| commit | dce927183cfec31fe8ca32ac7d58544f5c669bf9 (patch) | |
| tree | 8b1a153de0668244d02462b2d1450fc2705a7344 /runtime/lua/vim/_ftplugin/lua.lua | |
| parent | 02c98fb74fefa7573b8393e51005533a102a4f3a (diff) | |
| download | rneovim-dce927183cfec31fe8ca32ac7d58544f5c669bf9.tar.gz rneovim-dce927183cfec31fe8ca32ac7d58544f5c669bf9.tar.bz2 rneovim-dce927183cfec31fe8ca32ac7d58544f5c669bf9.zip | |
vim-patch:43725ac: runtime(css): Add additional CSS pseudo-classes and functions (#42192)
Problem: Other than `state()` these are widely supported CSS features
Solution: Add :host, :host-context(), slotted(), and state() CSS
pseudo-classes and functions (S0AndS0).
Reference:
- https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:host
- https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:host_function
- https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/::slotted
- https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:state
TLDR: `host` and `host-context()` are useful for shadowDom stuff,
`::slotted()` enables targeting elements passed/injected into a
`<template>` and `state()` enables targeting custom identifiers.
For example, currently I'm (ab)using `:host` as a drop-in replacement
for `:root` when defining variables that are intended to be shared
across custom/template elements;
- `./assets/css/host.css`
```css
:host {
--default__margin-block: 0.25rem;
}
```
- `./custom-elements/example.html`
```html
<template>
<link rel="stylesheet" href="/assets/css/host.css">
<style>
header {
margin-block-start: calc(var(--default__margin-block) * 2);
}
</style>
<header></header>
</template>
```
closes: vim/vim#21404
https://github.com/vim/vim/commit/43725acce680d1b999e22fad68cea99c2b593325
Co-authored-by: S0AndS0 <strangerthanbland@gmail.com>
Diffstat (limited to 'runtime/lua/vim/_ftplugin/lua.lua')
0 files changed, 0 insertions, 0 deletions