Re: [css-houdini-drafts] [css-typed-om] Something about !important (#922)

Yeah, you summed up my thoughts pretty much exactly.

My plan is indeed to go with a get/set method pair that adjusts the importance.

There is a question of whether we want to allow for the possibility of other bang-structures in the future. There's no plans for this *yet*, but I've considered it in the past; on the other hand, we can just not worry about that until it happens, and make this API easy to use for !important.

Given that we *have* given serious consideration to a `!default` priority in the past, we should make the method open-ended, not boolean. So probably:

```
style.getPropertyPriority("foo") // "important" or ""
style.setPropertyPriority("foo", "important"); (or "")
```

> What should happen if you set a priority value for a property that doesn't yet exist in the style map? Options: ignore it silently, throw, or generate a new declaration with the value set to unset.

I don't really want to set up a fake value for the property. I'm inclined to silently ignore.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/922#issuecomment-515199449 using your GitHub account

Received on Thursday, 25 July 2019 20:21:29 UTC