Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Fix theme styles and selector causing conflicts with Designa #24

Closed
wants to merge 1 commit into from

Conversation

alex-ketch
Copy link
Collaborator

These changes have been sitting around for quite a bit awaiting some of the fixes in stencila/designa#26.

Seeing these themes in action on /Open, I want to reevaluate some of the decisions and structures around the selectors and how we're writing the themes. My current hunch is that we might want to establish rules of targeting only block level elements which are direct descendants of an <article>. Though the details need to be ironed out regarding how to deal with child elements that we want to style as well, such as ol > li > figure.

* themes cause minimal conflicts with existing layouts and deeply nested components.
*
*/
@custom-selector :--pre pre, pre[class*="language-"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little uncomfortable with this use of custom selector for a non-semantic pre-formatted element. It feels a little ad-hoc. All the other uses of custom selectors below relate to an itemtype, an itemprop or containers for itemprops (e.g. authors). Looking below at the use of :--pre, it seem that to be consistent with that, we need a @custom-selector :--CodeBlock [itemtype='https://schema.stenci.la/CodeBlock']; and for Encoda to encode an itemtype for CodeBlock elements.

Generally, I think we should:

  • decide which Schema node type we are not going to add itemtype to in the HTML encoding (adding to p, li, strong etc is probably over the top)
  • in Encoda add itemtype to HTML encodings of all other node types
  • in Encoda, or here, autogenerate the @custom-selectors for the types and properties

@nokome
Copy link
Member

nokome commented Feb 11, 2020

As part of general housekeeping, I'm going to close this PR under the assumption that it is now out-of-date. Of course, feel free to re-open it.

@nokome nokome closed this Feb 11, 2020
@nokome nokome deleted the clean-up-styles branch February 29, 2020 01:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants