Comments (4)
Yeah, the fluid version is percentage based, so it doesn't work very well with nested grid units.
I just used this site to generate that version: http://grids.heroku.com
That's not to say the generator is flawed, just percentage based widths aren't very reliable.
Example:
http://www.slideshare.net/nathansmith/refresh-okc/68
Versus:
http://www.slideshare.net/nathansmith/refresh-okc/69
Same code, different browsers. Some round up, others round down.
from adapt.
Hi Nathan, thanks for the quick reply.
I'm aware of the rounding issues between different browsers, AFAIK the error offset will never be higher than 1% (or one pixel in most cases - unless you have a really huge resolution) but that would hardly be noticed by the naked eye... In this case the error offset can be as high as ~90%: if you have a grid_1
inside a grid_2
its width should be 48% and not 6.333%.
I've worked out a solution (see http://jsfiddle.net/jmSRu/) - I'm not sure if it's 100% correct but it seems to work. I've only patched a couple of combinations since a complete patch would require much more code and time but IMHO it's worth it, otherwise I don't see any reason to rely on the fluid version if nested grids are being used.
.grid_8 > .grid_4 {
width: 48.0%;
}
.grid_8 > .grid_4.alpha, .grid_8 > .grid_4.omega {
width: 49.0%;
}
.grid_9 > .grid_3 {
width: 31.333%;
}
.grid_9 > .grid_3.alpha, .grid_9 > .grid_3.omega {
width: 32.333%;
}
.grid_9 > .grid_6 {
width: 64.666%;
}
.grid_9 > .grid_6.alpha, .grid_9 > .grid_6.omega {
width: 65.666%;
}
I'm sorry for insisting on this issue but I got the impression that my point didn't get across clearly.
from adapt.
I get it, all I'm saying is that I didn't create the fluid version, so I can't vouch for it's production readiness. I threw it in as a proof-of-concept, but the real point of the Adapt.js demo isn't the CSS – I just wanted to show that the JS could be used to swap files on-the-fly.
I can put you in touch with the guy who created that generator site, if you like.
If you need nest-able fluid grids, YUI3 has one that's pretty solid...
http://developer.yahoo.com/yui/3/cssgrids
Demo:
http://host.sonspring.com/yui3_grid
Also, the OOCSS grid is fluid:
http://oocss.org/grids_docs.html
I've been meaning to do a write-up of how I'd approach fluid grids, but haven't had the time lately.
from adapt.
I understand, just making sure we were on the same page. :)
In case anyone else is interested, I coded a script to do the math and patch the adapt.js version of the VGS fluid variant (12 columns) - the resulting CSS is available at https://gist.github.com/1079728.
from adapt.
Related Issues (20)
- Nested grids on mobile. HOT 3
- Not an issue but an idea. HOT 3
- alternative to noscript HOT 1
- Remove all-or-nothing requirement tied to 'path' property HOT 4
- Feature request: Load multiple stylesheets for single range index HOT 2
- Question: What's the purpose of the timeout? HOT 9
- Callback gets called before css update HOT 4
- Problems with sizes due to delayed css insert HOT 7
- a suggestion to allow "media" to be a configuration option
- Responsive site with adapt HOT 3
- container_16 and container_24 HOT 1
- Demo files don't work locally in Chrome HOT 5
- Problem with .alpha and .omega in mobile.css HOT 2
- [enhancement] Add missing bower.json.
- adding adapt.js to cdnjs HOT 1
- You cannot not define the path HOT 10
- Allow dynamic reconfiguration.
- Does it affect SEO? HOT 2
- bug when I run SSL HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adapt.