Closed wheresrhys closed 10 years ago
Yep, the fixed position solution isn't fluid-friendly. I was also entertaining the idea of a js solution, but it would be a decent sized change to the module's inner-workings (sharing values between sass and js) and I doubt there's time/willingness to carry this out right now
I don't think this is a grid concern though. You can just not support it in the grid module and if someone wants to suddenly turn an inline element into a fixed position element, then it would be up to them to handle any sizing discrepancies that occur as a result.
I'll update the docs with another gotcha and remove (or put in a standalone, not-included-in-the-build file to serve as a reference). Leaving this issue open though to allow users to request this feature
Could add the following to v2
Add a class o-grid-detached
, and a js utility that, for each el which has the class, on load and resize or on calling a method creates a dummy copy of the el with position:static
, appends to the original el's parent, measures it and sets the width on the real el.
@triblondon
Currently trying to create a sticky (fixed) left-hand nav in the UISG. It appears the grid needs to be able to accept JS to do this. Could we have that feature please :)
Paul. I don't think sticky should be a feature of grid.
The stickiness itself: no but enforcing the grid widths: yes
The two issues are separate. You need JS to do sticky nav (which techdocs has), and since the JS is already doing positioning and sizing of the menu it's no great difficulty to also match its width to the width of the grid column that it sits in when it's not sticky. Techdocs already does this, though maybe there's a bug, if so that could be raised against techdocs.
The issue in grid is the ability to have fixed width columns combined with flexible width columns. I don't think we have a strong enough use case for doing that, and it also tends to encourage less responsive solutions.