Path: csiph.com!weretis.net!feeder7.news.weretis.net!news.roellig-ltd.de!open-news-network.org!news4.open-news-network.org!.POSTED.8.229.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: grid template rows Date: Mon, 19 Aug 2019 15:19:24 +0200 Organization: PointedEars Software (PES) Lines: 49 Message-ID: <1637788.VLH7GnMWUR@PointedEars.de> References: Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit Injection-Info: news4.open-news-network.org; posting-host="8.229.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch:178.197.229.8"; logging-data="6378"; mail-complaints-to="usenet@exeter.123backup.de" User-Agent: KNode/4.14.10 X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. With this HTML > >
> > console.log(container.style.gridTemplateRows); > > gives "64px 32px 1fr 32px;" Probably not. The delimiting semicolon is not supposed to be part of the property value. > But with this > > #container { > grid-template-rows: 64px 32px 1fr 32px; > } > >
> > let con = document.getElementById('container'); > console.log( window.getComputedStyle(con, > null).getPropertyValue("grid-template-rows") ); > > gives "64px 32px 497px 32px;" Probably not. Same reason as above. > That is, the third value is a pixel value instead of 1fr. I cannot reproduce that in navigator.userAgent === "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36". > How can I get the actual value as set in the CSS and not the pixel values? The only other way I know that might work in your case is to read the stylesheet directly. > I need to manipulate the value for grid-template-rows and the moment I > get the value, any fr unit is lost and the layout breaks. You can store the current “fr” value elsewhere. -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.