Coding Standard

Do you guys have any thoughts how you want developers to include custom styles?

Might end up in conflicts when using multiple dev-packs.

Hey @Beblebroks,

It’s always best to stick with tailwind classes where possible, it’ll ensure 100% compatibility with any other components you use, and reduce CSS.

However, it’s not always possible to do this, so when you need to use CSS you can scope a style to the instance of the component on the page using it’s id.

In the styles.css file

#{{node.id}} .heading {
    font-weight: bold;
}

And in the template file

<div id="{{node.id}}" class="p-10 text-lg text-center">
    <div class="heading">An interesting heading</div>
</div>

I thinking about a function you guys had years ago to obviouscate email. I am using a new CSS / JS approach to it. To avoid spam and that can not be achieved with Standard Tailwind.

.cryptedmail:after {
  content: attr(data-a) "@" attr(data-b) "." attr(data-c);
}

And use JS to fire the actual mailto. Works with Whatsapp as well.

Yeah ok, I think you should be able to use the same method posted above. Something like this

#{{node.id}} .cryptedmail:after {
  content: attr(data-a) "@" attr(data-b) "." attr(data-c);
}

And then use the {{node.id}} within the JS file too.

Works … awesome

2 Likes