[csswg-drafts] `window.getComputedStyle` equivalent `style()` function in CSS (#8968)

jd-solanki has just created a new issue for https://github.com/w3c/csswg-drafts:

== `window.getComputedStyle` equivalent `style()` function in CSS ==
> **Note**
> I'm new to this repo & CSS spec so if I posted at wrong place or somwthing wrong is at my side let me know. I just wanted to share this if this is possible via CSS.

Hi 👋🏻 

I really love how CSS is evolving these days and really loved #CSSDay ❤️ 

I'm building UI framework [Anu](https://github.com/jd-solanki/anu) and needed some CSS magic at some point. These magic includes:
- currentBackgroundColor
- contrast-color
- and more...

I wanted to share the idea got recently on CSS functions. We already have currentColor & there's already [proposal](https://github.com/w3c/csswg-drafts/issues/5292) for currentBackgroundColor. If we at these with bird view it comes down to JS version `window.getComputedStyle`. With JS's `window.getComputedStyle` we can easily fullfil requirement of `currentColor` & `currentBackgroundColor`

If we have similar function in CSS, let's say `style()` then we don't need keywords like `currentColor` & `currentBackgroundColor` at all 😱 

## Syntax

```css
style

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8968 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 15 June 2023 04:59:43 UTC