daisy / ebraille

Repository for developing use cases and standard for digital braille
16 stars 5 forks source link

Add section on CSS media queries and CSS restictions #189

Closed bertfrees closed 3 months ago

bertfrees commented 3 months ago

@wfree-aph @avneeshsingh @mattgarrish @clapierre @GeorgeKerscher

This is not a PR yet. I first want to summarize what I'm about to write, ask whether it is in line with our previous discussion, and ask where exactly you think it should be put: in the formal specification, in a note, in the best practices?

CSS restrictions

Rather than restrictions, these could also be CSS features that authors may use but reading systems should ignore. In any case, I think these should be mentioned somewhere:

CSS media queries

[^1]: grid is originally meant as a replacement for tty, but also applies to braille.

mattgarrish commented 3 months ago

I'm generally fine with all of this.

The only thing I wonder about is getting into embossing. You asked in the other pull request about mentioning the case in the intro. Maybe we should put it into the future directions section and mention there that we recommend not using the media type (and mention the possible alternatives), or at least to be aware that it may cause issues in the future and any use cases for it should be raised in the tracker. That way we don't accidentally paint ourselves into a corner with anything we say about it now.

bertfrees commented 3 months ago

OK, that sounds like a good approach!

bertfrees commented 3 months ago

OK, so how does this sound:

And what about these?

bertfrees commented 3 months ago

@mattgarrish Side question: how can ReSpec help us link from the best practices document to the main page?

mattgarrish commented 3 months ago
  • in a new section called "Media queries", after CSS support

You could probably just make this a subsection of CSS.

The best practices have no weight, so if we recommend using relative lengths there then it's a bit informal. As it's only a recommendation and not a requirement, I'd be fine having this in the specification's CSS section.

It might be worth a short note in the specification, that not all reading systems will support all features of CSS. EPUB does similar in its css intro. But if you think it'll take a lot of explanation, then maybe put a short note in the specification and expand on the details in the BP guide.

For these:

  • Say that reading system are expected to ignore font-related CSS properties: should this go in CSS support?

Do you mean add a "should not"? I'm fine with that in the CSS section. If you want to also say that reading systems should ignore the properties, that should go in the reading systems section so we keep those requirements separate from authoring.

  • Clarify that reading systems are expected to apply default styles?
  • Clarify that reading systems may apply styling through other means than CSS?

I wonder if these belong in another subsection of CSS or perhaps in an introduction. Maybe we end up with:

Cascading Style Sheets (CSS)

Or possibly scrap the last subsection and the introduction is where we explain that not all CSS will be supported and that reading systems may apply their own default style sheets and/or modify the styling during rendering in other ways. See how it goes as you write it up, perhaps.

mattgarrish commented 3 months ago

Side question: how can ReSpec help us link from the best practices document to the main page?

You could create a local bibliography entry in the header metadata, although we don't have a stable URL for the document yet.

It would be something like:

   "ebraille": {
      "title": "eBraille 1.0",
      "href": "https://daisy.github.io/ebraille",
      "publisher": "DAISY Consortium",
      "authors": [
         "Willow Free",
         "et al."
      ]
   }

That should let you use [[ebraille]] for citations and <a data-cite="ebraille#some-hash">xyz</a> for linking.

(Edit: changed "url" to "href" in the entry.)

wfree-aph commented 3 months ago

I agree with what's being discussed here and appreciate how much you both know about this process. Only thing I'm wondering about is do we need to define what CSS features will not be supported? I'm not seeing that explicitly said anywhere and I just wasn't sure how that gets defined.

mattgarrish commented 3 months ago

what CSS features will not be supported

That's probably tough to do given the scope of CSS.

My inclination is to rely on the best practices to guide to steer authors to what they should be using and call out only the ones that if used are likely to be problematic, like the font properties.

bertfrees commented 3 months ago

Thanks for all the help!

  • in a new section called "Media queries"

You could probably just make this a subsection of CSS.

My reasoning for putting it in a separate section was that media queries appear to be not necessarily tied to CSS. E.g. you could use a media query in JavaScript to enable functionality based on properties of the device. Or, the HTML media attribute can be used on other elements than style and link, e.g. you could have it on source elements to select different multimedia resources for different media queries.

As it's only a recommendation and not a requirement, I'd be fine having this in the specification's CSS section.

OK

  • Explain why we omit certain standard CSS features

It might be worth a short note in the specification, that not all reading systems will support all features of CSS. EPUB does similar in its css intro.

OK makes sense. I'm planning to mention specific CSS features/modules in the BP that we deliberately omit or treat with care for now, but a short note in the specification seems appropriate too.

  • Say that reading system are expected to ignore font-related CSS properties

If you want to also say that reading systems should ignore the properties, that should go in the reading systems section so we keep those requirements separate from authoring.

I was indeed thinking of saying reading systems should ignore the properties. Specifying all features that should be avoided/ignored might indeed be tough given the scope of CSS. That should not be an ambition. I'm hoping I can find a way to describe what we want to avoid (and show it in the BP) without going into the specifics.

  • Clarify that reading systems are expected to apply default styles?
  • Clarify that reading systems may apply styling through other means than CSS?

I wonder if these belong in another subsection of CSS or perhaps in an introduction. Maybe we end up with:

Cascading Style Sheets (CSS)

  • Introduction
  • CSS requirements
  • Media queries
  • (Reading system styling)

I was also thinking of eventually adding an appendix with a minimal default style sheet that user agents should apply, similar to https://www.w3.org/TR/CSS2/sample.html. Or this may end up along with all the locale-specific style sheets that we want to gather.

mattgarrish commented 3 months ago

media queries appear to be not necessarily tied to CSS.

Right, but the syntax is still defined by the CSS module. You could note that the restriction applies both within CSS style definitions and where media queries are used as a microsyntax, with a reference the relevant HTML section.

bertfrees commented 3 months ago

OK perfect.