marionettejs / marionettejs.com

:triangular_flag_on_post: Source files for the Marionette site
https://marionettejs.com
MIT License
26 stars 32 forks source link

Don't apply positioning directly to UI elements #408

Open peterblazejewicz opened 9 years ago

peterblazejewicz commented 9 years ago

@jdaudier via Gitter: We use critical and it simply takes some declaration that it thinks are critical for rendering path out of current CSS, moves to the top of the page. The other CSS is loaded asynchronously via JavaScript. It means that order of CSS declaration can change - as some declaration can be taken out of source CSS and moved to critical path, while the all code that creates it is still in original CSS. That's results in sometimes unfortunate CSS being applied when declaration is out-of-the-context, in different order than intended, etc:

20150413210542

Why this button should have a top margin? The lesson is to not position elements directly and position/layout their containers. This should fix that issue (if not, we will try to use helper classes as I wrote some time ago).

jdaudier commented 9 years ago

@peterblazejewicz thanks for the explanation! I'll have to fix this ... this weekend hopefully. It's been bugging me. :smile: