<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[`center` region problem.]]></title><description><![CDATA[<p dir="auto">MM uses some trick to keep position <code>center</code> (top_center, bottom_center) with <code>transform</code>(<code>-webkit-transform</code>).<br />
But it change module size unexpectedly.</p>
<pre><code class="language-html">&lt; div class="region top center" &gt;
&lt; div class="container" &gt;
&lt; div module id="SOMETHING" class="module ... " &gt;
&lt; div class="MY_MODULE_CONTENT" &gt; ...
</code></pre>
<p dir="auto">in CSS</p>
<pre><code class="language-css">#MY_MODULE_CONTENT {
  position:fixed;
  width:100%;
  height:100%;
}
</code></pre>
<p dir="auto">doesn’t work since <code>transform</code> of <code>center</code>.<br />
Is there any idea to escape it?</p>
]]></description><link>https://forum.magicmirror.builders/topic/9885/center-region-problem</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 20:38:11 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/9885.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 25 Feb 2019 10:32:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to `center` region problem. on Mon, 25 Feb 2019 17:17:00 GMT]]></title><description><![CDATA[<p dir="auto">@j-e-f-f<br />
Thanks for your instruction. I already have been using those tricks in my modules. Just wanted to know other way to achieve. :D</p>
]]></description><link>https://forum.magicmirror.builders/post/53155</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/53155</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 25 Feb 2019 17:17:00 GMT</pubDate></item><item><title><![CDATA[Reply to `center` region problem. on Mon, 25 Feb 2019 17:13:24 GMT]]></title><description><![CDATA[<p dir="auto">@sean You would have to override the CSS to remove the transform, but it may give you unexpected results elsewhere and maybe cause havoc with other modules.  I would avoid overriding MagicMirror’s core structure.</p>
<p dir="auto">Your idea to add and remove the hidden class in suspend and resume should work fine.  Just don’t create the overlay element as part of the <code>getDom()</code> routine.  Create it outside of that, and keep a reference to it in your code.  That way you don’t have to make repeated DOM lookups, and you’ll be able to update the container from anywhere in your code at any time.</p>
]]></description><link>https://forum.magicmirror.builders/post/53154</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/53154</guid><dc:creator><![CDATA[j.e.f.f]]></dc:creator><pubDate>Mon, 25 Feb 2019 17:13:24 GMT</pubDate></item><item><title><![CDATA[Reply to `center` region problem. on Mon, 25 Feb 2019 17:03:50 GMT]]></title><description><![CDATA[<p dir="auto">@j-e-f-f<br />
Yes. That might probably be one solution. But for module hiding, I need to add the code</p>
<pre><code class="language-js">suspend: function() {
  var overlayDiv = document.getElementById("MY_OVERLAYED_CONTENT")
  overlayDiv.classList.add("hidden")
}
</code></pre>
<p dir="auto">And also for module showing. (resume())</p>
<p dir="auto">So I just wanted to know any CSS trick to escape prior transform appliance.</p>
]]></description><link>https://forum.magicmirror.builders/post/53150</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/53150</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 25 Feb 2019 17:03:50 GMT</pubDate></item><item><title><![CDATA[Reply to `center` region problem. on Mon, 25 Feb 2019 16:58:29 GMT]]></title><description><![CDATA[<p dir="auto">@sean You don’t need <code>position:fixed</code>.  <code>position:absolute</code> will work just as well, since the composition never scrolls. The only caveat is that you will need to ensure that the <code>div</code> with the id <code>MY_OVERLAYED_CONTENT</code> is attached to the document root instead of as part of your module.  e.g.:</p>
<pre><code>var overlayDiv = document.createElement("div");
overlayDiv.setAttribute("id", "MY_OVERLAYED_CONTENT");
...
document.body.appendChild(overlayDiv);
</code></pre>
<p dir="auto">This also gives you the advantage of your overlay element being the last item in the draw order meaning that it will layer on top of everything else by default.  No need to futz around with <code>z-index</code> which can be a real pain in the bum.</p>
]]></description><link>https://forum.magicmirror.builders/post/53149</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/53149</guid><dc:creator><![CDATA[j.e.f.f]]></dc:creator><pubDate>Mon, 25 Feb 2019 16:58:29 GMT</pubDate></item><item><title><![CDATA[Reply to `center` region problem. on Mon, 25 Feb 2019 16:25:36 GMT]]></title><description><![CDATA[<p dir="auto">@j-e-f-f<br />
Yes I know <code>position:fixed</code> not working due to <code>transform</code>. But I need it. :(<br />
My goal is open <code>popup</code> layer.<br />
The html structure will be like this.</p>
<pre><code class="language-html">&lt; div class="region top center" &gt;
  &lt; div class="container" &gt;
    &lt; div module id="SOMETHING" class="module ... " &gt;
      &lt; div id="MY_NORMAL_CONTENT" &gt; .. &lt; /div &gt;
      &lt; div id="MY_OVERLAYED_CONTENT" class="hidden or showing" &gt; ... &lt; /div&gt;
</code></pre>
<p dir="auto">I want to draw <code>#MY_OVERLAYED_CONTENT</code> as some kind of popup. In all regions except <code>center</code> it could work perfectly, but not in <code>center</code>.</p>
<p dir="auto">I also know it can be achieved if my MY_OVERLAYED_CONTENT is appended into  <code>body</code> directly, But as you know, it is not so graceful. When <code>module.show()</code> and <code>module.hide()</code> is called, that parts which appended into <code>body</code> directly  should be mangaed in <code>.suspend()</code> and <code>.resume()</code>. I don’t want it just for positioning in <code>center</code> region.</p>
]]></description><link>https://forum.magicmirror.builders/post/53143</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/53143</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 25 Feb 2019 16:25:36 GMT</pubDate></item><item><title><![CDATA[Reply to `center` region problem. on Mon, 25 Feb 2019 16:14:39 GMT]]></title><description><![CDATA[<p dir="auto">@sean the <code>position:fixed</code> property won’t work because it has a CSS transform applied.  This is a limitation of CSS.  What are you trying to achieve with your positioning?  Maybe I can suggest a different way.</p>
]]></description><link>https://forum.magicmirror.builders/post/53138</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/53138</guid><dc:creator><![CDATA[j.e.f.f]]></dc:creator><pubDate>Mon, 25 Feb 2019 16:14:39 GMT</pubDate></item></channel></rss>