You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll introduce the problem with a scenario:
You want to create themed components so you need to define <style> tags within the manialink. These styles are the same for all components and manialinks. So instead of re-defining all the styles in each and every manialink and component, you create a single component with all the styles in.
You can now import this component and just type something like <Theme /> to add it to the manialink.
But there is a problem: Since every component needs this available, and we don't know if it is available, and to avoid boilercode, each component includes the theme styles. So now you have the styles defined over and over again for each of the components used in a manialink.
What would be great is to have some sort of way to just include or append these styles once. I'm thinking of a syntax such as
<appendcomponent="Theme" />
In this case it will always append the contents of the component Theme. But if you want to only append it once, you can use the once modifier:
<appendcomponent="Theme"once="true" />
Because it is rendered like a component when it is included, you can even pass properties to it:
I'll introduce the problem with a scenario:
You want to create themed components so you need to define
<style>
tags within the manialink. These styles are the same for all components and manialinks. So instead of re-defining all the styles in each and every manialink and component, you create a single component with all the styles in.You can now import this component and just type something like
<Theme />
to add it to the manialink.But there is a problem: Since every component needs this available, and we don't know if it is available, and to avoid boilercode, each component includes the theme styles. So now you have the styles defined over and over again for each of the components used in a manialink.
What would be great is to have some sort of way to just include or append these styles once. I'm thinking of a syntax such as
In this case it will always append the contents of the component Theme. But if you want to only append it once, you can use the
once
modifier:Because it is rendered like a component when it is included, you can even pass properties to it:
The text was updated successfully, but these errors were encountered: