W3C home > Mailing lists > Public > www-style@w3.org > April 2014

Re: Can we have more maths in calc()?

From: Zack Weinberg <zackw@panix.com>
Date: Sun, 6 Apr 2014 21:36:11 -0400
Message-ID: <CAKCAbMibmjR4L+s34FK+shaYygOG228Ng5x2HnLnLHTNwuVXkA@mail.gmail.com>
To: www-style list <www-style@w3.org>
If I can have _just two_ additional calc() features, min() plus being
allowed to divide one <length> by another (the result being a
dimensionless number) would mean not needing JavaScript in a scenario
I encountered yesterday: the script in the attached HTML file could be
replaced with

    #outer { transform: scale(calc(min(640px/100vw, 480px/100vh))); }

Received on Monday, 7 April 2014 01:36:35 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:39 UTC