question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Web: Make AttrBuilderContext Composable

See original GitHub issue

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
hfhbdcommented, Sep 13, 2022

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.

1reaction
hfhbdcommented, Sep 12, 2022

@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:

Style {
    val classname = remember { "_${UUID()}" }

    className(classname) style {
        // apply the styling
    }
}
return classname

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found