-
Notifications
You must be signed in to change notification settings - Fork 24
Added limitations section first draft #64
Changes from 1 commit
33b80cf
6c0fa42
97e7483
fc9606a
5aed3fa
e42b888
28f7e75
8095558
120ab14
1e52054
5fbdad6
a009cf9
539058e
2349d28
69d7c26
2b6c656
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,27 @@ The module in this new sidebar context will never need to reflow to the wider la | |
<figcaption>A stylesheet heatmap showing added redundancy and rewriting of existing styles required to accommodate the layout variation in <a href="#fig-4">fig. 4</a> </figcaption> | ||
</figure> | ||
|
||
<h2 id="limitations-of-current-techniques">Limitations of current techniques</h2> | ||
|
||
There is currently no native CSS mechanism available to developers that achieves the primary function of container queries, which is to <em>employ the full capabilities of CSS to a specific element tree based on the state and properties of their container</em>. Therefore developers must look to workarounds to achieve their goals. These workarounds and their limitations are outlined here: | ||
|
||
The use of <strong>Media Queries</strong> can only affect CSS changes based on the state and properties of the viewport. The viewport is not a good indicator of the state and properties of a particular container within the viewport. | ||
|
||
The use of <strong>CSS layout methods</strong> such as <strong>Flexbox</strong> and <strong>Grid</strong>, alongside <strong>CSS-based workarounds</strong> (such as the <a href="https://medium.freecodecamp.org/the-fab-four-technique-to-create-responsive-emails-without-media-queries-baf11fdfa848">Fab Four technique</a>) cannot employ the full capabilities of CSS on an element tree. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should probably briefly say what the fab four technique is. like: "such as the fab four technique, which bla bla briefly bla bla" It's unlikely the reader has heard of this (I'd never heard of it)... but the reader should be able to get the basic gist of what it is, and then continue reading... with the option of clicking the link if they want more info. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I’ll give it a go. I want to avoid bloat, but you’re right, it needs context. I guess I assumed the link to the technique was enough. |
||
|
||
The use of <strong>iframes</strong> produces the closest effect to what Container Queries is intended to achieve, but their use has two significant drawbacks: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The “two significant drawbacks” are now three 🤓 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doh! Of course, good spot. |
||
<ol> | ||
<li> | ||
Without the use of JavaScript, iframes require that the contents of the iframe are stored in a <em>separate HTML document</em> rather than being part of the current document. This necessitates a new document composition paradigm that’s very different from the methods currently employed by developers. | ||
</li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It also incurs the additional overhead of unnecessarily spinning up an additional nested browsing context, which can degrade performance (lots of iframes would be bad!). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. Someone want to come up with some wording for that for me to include? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think @marcoscaceres already nailed it. How about just,
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops! I see you already basically did this in a009cf9 – apologies. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<li> | ||
The contents of an iframe do not natively affect the dimensions of the iframe itself. The contents of a container that is the subject of a Container Query are still expected to be able to affect the layout of its parents in the <em>opposite</em> dimension of the query. For example, in the case of a Container Query that is based on a containers <em>width</em>, it is still expected that the container’s contents affect the <em>height</em> of a container, subject to any overflow rules. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Despite having some security implications, iframes on mobile safari on iOS are affected by the document contained inside them. By default, the height of the iframe expands to match the height of the embedded document. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ this was referring to this wording:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, thanks. Will consider how to re-phrase that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tomhodgins - I've re-phrased. This part of the conversation is now 'outdated'. |
||
</li> | ||
</ol> | ||
|
||
<strong>JavaScript-based solutions</strong> (for example <a href="https://elementqueries.com/">EQCSS</a>) should not be considered an adequate replacement for a native CSS solution for all the same reasons any other layout- or appearance-based declarations are the domain of CSS, not JavaScript, and the usual caveats of JavaScript availability and failure still apply. JavaScript solutions also create additional network traffic and require additional parsing. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should add information about the additional reflows here too. @andykirk do you want us to discuss this right here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi. Not sure / don't mind. Happy to discuss here as @beep suggested, but also happy with your suggested change. Maybe we can amend this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Amending seems right to me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ausi PR amened. This part of the conversation now 'outdated'. |
||
|
||
|
||
<h2 id="requirements">Requirements</h2> | ||
|
||
The use cases give rise to the following <dfn id="dfn-requirements">requirements</dfn>: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this is screaming to be a bunch of list items, a definition list (with a brief name for each workaround), or even small sub sections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to highlight how ridiculously complex a media query could be, so showing one here would help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First point - that’s fine, it’s just how I write. I can change that.
Second point - I thought the original work in the Use Cases section inferred that complexity.
The article by Mat Marquis does illustrate it further. Perhaps a link to that? If not, perhaps some else can find one in the wild or write one? I don’t really have the capability to to come up with a good example at the moment and I don’t want to hold things up.
Again, I’d like to avoid bloating this if possible.