Skip to content
Discussion options

You must be logged in to vote

I'd suggest following what @ronaldohoch already mentioned as Traits are designed to handle mainly attribute and property values (eg. which don't depend on media queries) and Style Manager is designed to handle responsive styles.

Though you can still make a fully custom traits logic to handle specific values (definitely useful only for advanced use cases) you just need to indicate how to get/set your custom value.

traits: [
 {
   name: 'custom-trait-update-html'
   getValue: ({ component }) => {
      // The value is the inner HTML content
     return component.getInnerHTML();
   },
   setValue: ({ component, value }) => {
     // Update the inner HTML with a new value
     component.compo…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@addlistener
Comment options

@ronaldohoch
Comment options

@addlistener
Comment options

@ronaldohoch
Comment options

Comment options

You must be logged in to vote
1 reply
@addlistener
Comment options

Answer selected by addlistener
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants