Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom HTML tags #12

Open
tmedwards opened this issue Apr 19, 2020 · 2 comments
Open

Custom HTML tags #12

tmedwards opened this issue Apr 19, 2020 · 2 comments
Assignees
Labels
investigate Information gathering is needed

Comments

@tmedwards
Copy link
Owner

Consider using custom HTML tags within SugarCube's UI where appropriate. Meaning limited to areas where I'd be temped to use Shadow DOM if I could—i.e., various control wrappers mostly—and only to replace tags with no inherent semantic meaning of their own—e.g., <div> and <span>.

Reasoning

Replacing non-semantic tags with custom tags on a limited basis could serve various purposes:

  • Custom tags would have inherent semantic meaning—e.g., <sc-slider>, <sc-volume>, <sc-textbox>, etc.
  • Custom tags would bypass some user sloppiness with their own CSS selectors—only some, however.
  • Custom tags would allow certain other features to work easier—e.g., <br> to <p> conversion.

Thoughts?

@tmedwards tmedwards transferred this issue from another repository Aug 2, 2020
@tmedwards tmedwards self-assigned this Aug 2, 2020
@tmedwards tmedwards added the investigate Information gathering is needed label Aug 2, 2020
@Uzume
Copy link

Uzume commented Oct 20, 2020

You might want to consider this in the light of the current template system even though it currently uses a different markup system with leading question marks. I am not a fan of the leading question mark system anyway as it is too hard to find the end reliably (e.g., how does one use a template then put a letter right after it? ?xy when I want template x and a literal y). #18 could also be solved with an explicit and custom line break tag. When reading that I definitely though of using SC templates for explicit line breaks. If you are considering such things, you might also want to consider arguments and making them more like macros. I think a template system where they are just macros with literal substitutions that are not further expanded makes sense. That means they should have content with either end tag, Harlowe hooks autoclose styles or force all content into arguments (like I mentioned in #15 ).

@Uzume
Copy link

Uzume commented Sep 11, 2021

If you do end of using custom element tags, you should probably define them (along with those specified in the Twine 2 HTML Output specification). This is now quite standardized and available in most browsers today. See Can I use: Custom Elements V1 and Custom elements. This might also be applicable to your thoughts on syntax changes #15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Information gathering is needed
Projects
None yet
Development

No branches or pull requests

2 participants