Coder-Spirit / beautiful-tree

A library to generate beautiful trees in your website
https://www.npmjs.com/package/@beautiful-tree/react
MIT License
16 stars 4 forks source link

feat(react): allow dynamic inline styles #33

Open castarco opened 1 year ago

castarco commented 1 year ago

Allow dynamic inline styles, as they are quite useful when generating numeric values that can be predicted in advance (so we can't prepare specific CSS classes for them).

Sicolas-Flamel commented 1 year ago

By allowing dynamic inline styles, you can generate styles directly in the HTML or code, making it more flexible to apply styles based on dynamic or computed values. This approach could potentially enhance the maintainability and readability of your code by keeping the style-related logic closer to where it's actually used.

Here's a simplified example of how dynamic inline styles might look in HTML and JavaScript:

const dynamicWidth = 200; // Computed or predicted width value const dynamicHeight = 150; // Computed or predicted height value

document.getElementById("dynamicDiv").style.width = ${dynamicWidth}px; document.getElementById("dynamicDiv").style.height = ${dynamicHeight}px;

Shouvik11-b commented 1 year ago

Can I take up this issue??

castarco commented 1 year ago

@Shouvik11-b feel free to take it! 😄 , it's always a pleasure to have some people jumping into the project.

Now I don't have much time to provide guidance, but I'll check in later and write something more in detail. In any case, I suspect you'll do fine 👍🏻 .

castarco commented 1 year ago

Hi @Shouvik11-b, how are you doing with this one? Do you need any help/guidance?