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

TML - Add styling (similar to css) #37

Open
Kiyoshika opened this issue Jul 24, 2023 · 0 comments
Open

TML - Add styling (similar to css) #37

Kiyoshika opened this issue Jul 24, 2023 · 0 comments
Labels

Comments

@Kiyoshika
Copy link
Owner

Could be convenient to have styling, but instead of having a separate <style> tag we may do something directly in <script>. Something like: (note that all of the attribute names in the class must be publicly accessible and named exactly the same as the original attributes)

<tml>
  <text class=myTextClass>hey</text>
  <text class=myTextClass>yo</text>

  <script>
    class myTextClass {
      public bool bold = true;
      public colour fg = colours.yellow;
      public colour bg = colours.blue;
      public bool newline = false;
    };
  </script>
</tml>

would be equivalent to

<tml>
  <text bold=true fg=yellow bg=blue newline=false>hey</text>
  <text bold=true fg=yellow bg=blue newline=false>yo</text>
</tml>

It may not be a big deal in this small example, but for larger amounts of generalizable elements it may come in handy.

@Kiyoshika Kiyoshika changed the title Add styling (similar to css) TML - Add styling (similar to css) Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant