@@ -27,7 +27,7 @@ http://csswizardry.com/2011/10/the-island-object/
2727}
2828
2929
30- // SIZE MODIFIERS
30+ // SPACING MODIFIERS
3131// --------------------------------------------------------------------------------------------------------------------------------------
3232
3333/*
@@ -77,4 +77,57 @@ to better visually balance a box.
7777 }
7878 }
7979 }
80+ }
81+
82+
83+ // SIZE MODIFIERS
84+ // --------------------------------------------------------------------------------------------------------------------------------------
85+
86+ /*
87+ Generates fixed width and height variants using data from settings.spacing
88+ */
89+
90+ // Generate using settings.spacing
91+ // Example: o-box--width-tiny
92+ // Example: o-box--height-tiny
93+ @each $sp-name , $sp-value in $spacing {
94+ .o-box--width-#{$sp-name } {
95+ width :rem ($sp-value );
96+ }
97+ .o-box--height-#{$sp-name } {
98+ height :rem ($sp-value );
99+ }
100+ }
101+
102+ // Create responsive variants using settings.breakpoints
103+ // Changes padding when breakpoint is hit
104+ // Example: o-box--width-tiny@md
105+ // Example: o-box--height-tiny@md
106+ @each $bp-name , $bp-value in $breakpoints {
107+ @include bp (#{$bp-name } ) {
108+ @each $sp-name , $sp-value in $spacing {
109+ .o-box--width-#{$sp-name } \@ #{$bp-name } {
110+ width :rem ($sp-value );
111+ }
112+ .o-box--height-#{$sp-name } \@ #{$bp-name } {
113+ height :rem ($sp-value );
114+ }
115+ }
116+ }
117+ }
118+
119+ // Changes padding until breakpoint is hit
120+ // Example: o-box--width-tiny@max-md
121+ // Example: o-box--height-tiny@max-md
122+ @each $bp-name , $bp-value in $breakpoints {
123+ @include bpMax (#{$bp-name } ) {
124+ @each $sp-name , $sp-value in $spacing {
125+ .o-box--width-#{$sp-name } \@ max-#{$bp-name } {
126+ width :rem ($sp-value );
127+ }
128+ .o-box--height-#{$sp-name } \@ max-#{$bp-name } {
129+ height :rem ($sp-value );
130+ }
131+ }
132+ }
80133}
0 commit comments