-
Notifications
You must be signed in to change notification settings - Fork 408
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
View class steroids 馃檶馃徑 #580
Comments
Component classes can optionally declare methods styles() that returns css in string for that component and it only be applied one time when component be used multiple timesclass MyComponent {
function render(): string {
// render html
}
function styles(): string {
return <<<css
body {
color-scheme: light dark;
}
css;
/* or if you want to link and external file, or you want to add attributes to the <style> or <link>
return <<<html
<style media="print">
</style>
html
*/
}
} Add the same as styles but for JS scripts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Componetization syntax
Current:
Requested馃檶馃徑馃敟
f
prefix can be customizable/views/components
is taken by default and map functions or classesThe text was updated successfully, but these errors were encountered: