Web: Make AttrBuilderContext Composable
See original GitHub issuehttps://github.com/JetBrains/compose-jb/blob/471d5c652db20286d478c25c2b3d80ab4200215a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/elements/Base.kt#L21 It is already Composable, but this feature/annotation is no forward to other calls, namely: https://github.com/JetBrains/compose-jb/blob/471d5c652db20286d478c25c2b3d80ab4200215a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/elements/Base.kt#L109
Use case:
Use remember
in the styling api to create ids automatically.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Material Design 2 in Compose - Jetpack - Android Developers
Jetpack Compose offers an implementation of Material Design, a comprehensive design system for creating digital interfaces. The Material Design components ...
Read more >How to read the result of Flow in Android Compose ...
So - I am trying to to just one thing - read DataStore (1. as attribute of the Context, because there is no...
Read more >Compose file build reference - Docker Documentation
Compose file build reference. Compose specification is a platform-neutral way to define multi-container applications. A Compose implementation focusing on ...
Read more >Complete guide to Rich Text in Jetpack Compose
This article teaches how to customize text content in Jetpack Compose and shows advanced use cases of some utilities.
Read more >Exploring Jetpack Compose: Text | Joe Birch
ui.core package. This component provides us with a collection of attributes to control the appearance of our text. @Composable fun Text( text: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t know, I didn’t start the rewriting yet. Because I want to use the inline style api instead, I don’t need a generated id (no
<style>
elements) in the end, if it works. The rewrite should not be composable.While this snippet/the function sounds helpful, I hope I don’t need it at all 😃 So thanks for the feedback to ask for the real use case.
@eymar Thanks for the feedback! The goal is to support
display-grid
(and some other css features): https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout In the sample of MDN, they use classes and bootstrap-compose generates these class names automatically with a UUID. So we use this:and the same class name in the actually HTML element.
But in the end, I dislike this behavior. Instead, I should use the
AttrsScope.style
function with “in-memory” style sheets than writing the style in the DOM and using the same class name.While this PR would simplify my current implementation, I think, it would be better to implement it with
AttrsScope.style
instead, somehow in the long term.So after rethinking the current bootstrap-compose implementation I would keep the behavior in
compose-jb
and change my implementation instead.