feat(css): Add example of @counter-style and all of its descriptors#2089
feat(css): Add example of @counter-style and all of its descriptors#2089
@counter-style and all of its descriptors#2089Conversation
|
Thanks for this PR, @NiedziolkaMichal ! I don't have time to review now, but:
I remembered this after our conversation: #887 . Maybe the same thing? |
|
Yes, it looks to be the same issue, although @font-face doesn't work on both firefox & chrome, while @counter-style works fine on chromium based browsers. Is there any way to make it work? |
|
I don't know, @NiedziolkaMichal , sorry, @schalkneethling , do you have any ideas about this? I'm afraid that this is quite likely a blocker for this idea. There is more information here:
|
|
@NiedziolkaMichal thank you for your continued contributions. I believe your recent pull request on mdn/bob will address the issues mentioned here? If so, let’s keep this one around until that one is merged. Thanks! |
|
@schalkneethling No, this PR will still not work on Firefox, because output is presented in shadow tree. Recently I have been prototyping on replacing shadow DOM with iframe in HTML interactive examples. It would make it possible to use all at-rules and WebAPI examples, without much effort. Is there any important reason why you have chosen shadow dom instead? |
I honestly cannot remember :) I believe it could have been because we were, and still are, considering moving interactive examples into content without it being hosted in an |
|
@schalkneethling Making HTML examples be operational without either iframe or shadow DOM would be tricky. There are plenty of examples, like p, using selectors that would affect rest of the layout. |
Yes, and so the hope/intent was that |
|
There are I think 2 levels here:
At the moment the complete example is in an iframe, of course, and the output pane is in shadow DOM to stop it leaking into the editor UI. So even if the complete example was "inline" in the page, we'd need to isolate the output.
That's interesting! So we'd have an iframe inside an iframe? I might have mentioned this a few thousand times before, but I'd love to have Web API interactive examples on MDN. |
Hey, @NiedziolkaMichal , I have been trying to write this whole thing up and found this: #706 which is where we decided to use shadow DOM. It was also suggested there that an extra iframe could be a solution. Just in case this bit of history could help :). |
|
@wbamberg In the iframe PR, I believe that those issues don't exist. Applied CSS rules, don't select anything other than output. Clicking on links opens new browser tab. My solution also don't generate two separate documents, output exists only in memory and is applied via srcdoc attribute. On my device, I also didn't notice any performance issues. |
Thanks for checking! It's great that your solution doesn't suffer from the possible problems discussed there. |
200d874 to
a16a34e
Compare
@counter-style and all of its descriptors
estelle
left a comment
There was a problem hiding this comment.
Looks good. My suggestions include adding white space, using double quotes, and adding an example of a using a quote as a symbol.
I created a PR to add a comment about white space and quotes; so our example follow our best practices, but the content indicates that if you don't it should still work.
The formatter doesn't seem to like this, so I've added in f4c78a4 to make things green, I hope that's okay. |
bsmth
left a comment
There was a problem hiding this comment.
One suggestion open to prevent the line wrapping, but looks good aside from that, leaving a +1 👍🏻
|
Thanks everyone for the work! Merging shortly 🚢 |
It adds interactive examples to @counter-style and all its descriptors except for speak-as, which doesn't have any visual impact.