Financial-Times / o-grid

Responsive grid system
http://registry.origami.ft.com/components/o-grid
93 stars 14 forks source link

Confining the grid to a container #28

Closed wheresrhys closed 9 years ago

wheresrhys commented 10 years ago

So that e.g. .grid-area prefixes each of the grid stylesheet's selectors

Proposed implementation

$o-grid-selector: null !default;

oGridWrapInSelector($o-grid-selector) {
    // the grid
}

Prerequisite for https://github.com/Financial-Times/o-grid-issues/issues/27

KittyGiraudel commented 9 years ago

Here is your implementation:

@mixin wrap($selector: null) {
  @if $selector {
     #{$selector} { @content; }
   } @else {
     @warn "Mixin `wrap` included but no selector was given. Content will not be wrapped.";
     @content;
  }
}
kaelig commented 9 years ago

@wheresrhys do we have a use case for it?

wheresrhys commented 9 years ago

Ages ago I raised a few issues in order to granularly document some features originally requested by @kavanagh, to see if anyone else wanted them too. The use case I think is to enable having parts of a page which use a different grid. Fine by me to close this

kaelig commented 9 years ago

Thanks @wheresrhys. Closing this until a real world use case comes up.