Hope you don’t mind asking: Now you have quite a lot of stuff on a button / screen. Most information is there actually triple, sometimes four times. eg when you have a light on: Icon is yellow, button is bright, it mentions “on” and if dimmable there is a number%. They all tell you the same info “light is on”. Does that not cause more ‘cluttering’ then needed to give you the info you would want to see at a glance?
Perhaps yes, but I wanted to make a close copy of the original homekit button. So that is why all this info is there, as it is also there within homekit. (The only thing that is different is the brightness level, which only shows on Homekit when it is actually turned on).
@RomRider the card is really great, however I have a slight problem. It all works fine at start, but after a few minutes this starts to happen (note that it only happens to buttons that are in the “off” state). When the button is in the “on” state nothing is wrong.
That is really great, well the thing is, I have the 2.0 app (latest build) I run the latest ios (12.3) I run the latest HA (0.93.0dev) and I still have this problem. What’s crazy is that it only does it with buttons that are in the “off” state (and only after switching some lights). It might be some other code that is conflicting, will have to sort that out. Or maybe another card that is conflicting like CCH or swipe navigation?
Still great to see my post helped someone.
Edit: I have to mention that all experimental features in Safari are turned on, I don’t know if that impacts the app though, but considering it probably uses the same webkit it could be possible.
Edit2: I turned off all experimental features in safari, so far so good. I do not have the problem (yet). Will report back if it does again though.
Edit3: it still seem to do it although less prominent. I will try removing some unnecessary lines of code as I think I have like 2 vertical-stacks in a vertical-stack etc. or perhaps something else is causing it.
Right, but on a phone vrs a browser the horizontal space is not the same. Especially if you change the shape of the browser. So now on the phone 4 buttons will fill a horizontal row, where on a browser 3 will. I’d like to get it so that 4 buttons are always displayed per row and they are always square. Regardless of who is viewing it. This would require a calculation to be performed on the fly based on the width of the column that the buttons are placed into.
Same configuration 2 different results. height: 90px & width: 90px
phone:
browser:
So in summary, I want a square button that is dynamic in size. I.E. A button that holds to a ratio and does not have a fixed size in pixels.
Weird, I had 4 buttons in a row all the time on my ipad. Though admittedly they weren’t squared like they were on my phone. They got rectangle.
If you style all elements then you would be able to recreate something like this (e.g. give all your elements a width, including the markdown cards). But dynamically is not possible I think.
I’d use the config-template-card for this, it’s quite straightforward and doesn’t require you to duplicate the code like in @jimz011’s solution
That’s not possible I’m afraid. Each element doesn’t know if it has neighbour or not. You have to specify a dimension at least (in px or anything else) else how would it know what size it should be? An aspect ratio of 1/1 is understandable, but based on what fixed size? If I tell you I have a 16/9 TV, you can’t guess its size, you can only say it’s 16/9, maybe it’s 2 inches or maybe 100 inches. But unless I tell you at least one dimension, you can’t figure out what is its real size. CSS is not magical and neither am I
What I can think about though, is using the @media css feature. But you’d have to inject pure CSS in the config of the card… I’m going to think about this… Basically what you’d say is if my screen width is less than xxx in pixels width then you set one width on the card, else you set another width.
I like what you did on your setup
Why is there a point in the label? Is it because if the string is empty, it doesn’t display the line at all? You can use as the value I think to fix that.
I’m wondering if it’s not because of your - margin: -10px. In the next version, you’ll be able to align the icon and will not need to play with margin and other stuff (see my example here)
Yes I know it was just a test to see what I could make. In that particular screenshot I forgot to make the dot disappear with css (by making it transparent). Yes I wanted it so that the text would be aligned with the other buttons so I needed that line, thanks for the tip I completely forgot how to do that and I couldn’t easily find it on google (this one I mean: ).
My current result looks like this:
@PodPerson I really like your button within button examples, so thank you for sharing! Must admit though, having type at the bottom of each card is a bit of a head scratcher for me!