Read the statement by Michael Teeuw here.
Left to Right Modules, instead of top to bottom?
-
I actually figured out something that could help, if I open a dev console in firefox and I change the container div inside the region upper third div to have a display: flex; it flows left to right. Now I just need to figure out spacing
-
I’m not entirerly sure about that but if you check the index.html within the mirror you can see
then in the main.css of the css folder we can see
.region { position: absolute; } .region.fullscreen { position: absolute; top: -60px; left: -60px; right: -60px; bottom: -60px; pointer-events: none; } .region.fullscreen * { pointer-events: auto; } .region.right { right: 0; } .region.top { top: 0; } .region.top .container { margin-bottom: 25px; } .region.top .container:empty { margin-bottom: 0; } .region.top.center, .region.bottom.center { left: 50%; -moz-transform: translateX(-50%); -o-transform: translateX(-50%); -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); } .region.top.right, .region.top.left, .region.top.center { top: 100%; } .region.bottom { bottom: 0; } .region.bottom .container { margin-top: 25px; } .region.bottom .container:empty { margin-top: 0; } .region.bottom.right, .region.bottom.center, .region.bottom.left { bottom: 100%; } .region.bar { width: 100%; text-align: center; } .region.third, .region.middle.center { width: 100%; text-align: center; -moz-transform: translateY(-50%); -o-transform: translateY(-50%); -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); } .region.upper.third { top: 33%; } .region.middle.center { top: 50%; } .region.lower.third { top: 66%; } .region.left { text-align: left; } .region.right { text-align: right; } .region table { width: 100%; border-spacing: 0; border-collapse: separate; }
First you can see that the module side to side (top left, top center, top right and the bottom counter part) are not at the same level that other places they are inside the container of the top bar.
Also when you watch the css you see that all class except for those havewidth: 100%
.You can see that for the class left and right, they do a
text-align: left
and atext-align: right
and for the class center they do aleft: 50%
and all sort of translation.So I am guessing that if you wanted to replicate that behaviour for the upper third, middle center and lower third, you could add new region under their container and make sure to choose a class name including left, center and right respectively.
class=“region left” as an example so it apply the . It might be enough (you can see that the class “upper third” have atop:33%
but the classthird
itself have awidth:100%
so you don’t want to includethird
in the class name yet you want thetop:30%
so maybe creat a new class that do thetop:33%
. let’s call itcustom_upper_third
as an example:.region.custom_upper_third { top: 33%; }
so your html could look like
Then you do the same for the other sides.
Keep in mind that I didn’t test this and that I’m quite new in html / css / javascript so I might be wrong about this
-
I thought about that, and it wouldn’t exactly work for my case as I might have indefinite columns in this row. This however does make sense and I could create a custom number of columns for every module I want to add, it just seems like poor practice to me and not very modular.
-
@DongerZone True, but far as I can tell, html/css isn’t very modular by itself. Unless you use something else like javascript to generate your html/css as you go. (or change it anyway)
-
-
@broberg That just moves the entire div as far to the left as I can tell, I want to rearrange all the modules in one region to go left to right.
-
@broberg Oh it seems to work if I apply it to the class belonging to the module, thank you.
-
Hi you all,
I want to do the exact same thing in the upper third region i want to have a module on the left and a module on the right how do i do that i have no clue??
I have no experience with css or html
so i need a step by step per say :)i will greatly appreciate it if anyone can help
Denis
-
@richland007 If you just want to have a module in the upper left and another module in the upper right, you should probably assign one to the
top_left
and the other to thetop_right
regions in theconfig.js
file.See the Magic Mirror readme file for more information.