From edc09b850cb756d2b6605ce3948c03fdb6ad18ea Mon Sep 17 00:00:00 2001 From: Blackbaud-SteveBrush Date: Tue, 19 Sep 2017 17:42:29 -0400 Subject: [PATCH] Added xsmall breakpoint for fluid-grid --- ...allest-Differentrows-chrome-600x800-dpr-1.png | Bin 9255 -> 0 bytes .../fluid-grid/fluid-grid-visual.component.html | 11 +++++++++++ .../src/app/fluid-grid/fluid-grid.visual-spec.ts | 8 ++++---- .../fluid-grid/fluid-grid-demo.component.html | 8 ++++---- src/app/components/fluid-grid/index.html | 7 +++++-- src/modules/fluid-grid/column.component.scss | 2 ++ src/modules/fluid-grid/column.component.spec.ts | 2 ++ src/modules/fluid-grid/column.component.ts | 7 +++++++ 8 files changed, 35 insertions(+), 10 deletions(-) delete mode 100644 skyux-spa-visual-tests/screenshots-baseline/fluid-Grid-Screensmallest-Differentrows-chrome-600x800-dpr-1.png diff --git a/skyux-spa-visual-tests/screenshots-baseline/fluid-Grid-Screensmallest-Differentrows-chrome-600x800-dpr-1.png b/skyux-spa-visual-tests/screenshots-baseline/fluid-Grid-Screensmallest-Differentrows-chrome-600x800-dpr-1.png deleted file mode 100644 index 85558dff816fe751a7ecf308f20caf898ff47fc8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9255 zcmeI2WmFu^+vag6*kHkJ(BSS6Y{=jqBsd{Ra0@{uxO;H7;O@@g4grD%hY&mvTy{vF z|0^GM&%V1K_WiKu^qIL&^{K9|uBy9!*VP@Wsw|I<@f-sV4h|cnAfpZkhoB3KCD2e{ zzoKXj#BgwQM<5v~O%M3PZfvlod+y2OaZ>y$XbTIy2sikv1=y-2#Tp6Z0g^QAPB8t% z;l6T_Q_s*kJ5pk!L)&dkPZBDZ%RKd{ZjJph^kb6M&yq&<8g&J!k71x#sJfGty4zdf z1Z=Z>Gj1&4uBh3C1fpp{hsl0}$L+1R&+nf32VWXc96jt1<5lb^{8ua*{jW&#KSZas zXgqgA16U7qqXE@49il6JiCmPRphwzF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0PN z=Kns&uSCANk$`!v&!VtxMU$idqM$g2hGvE*>m1knKHgcJ*>I97^|uCAIO=n$SnC_X(M_kCF^$6wh-eIPmk(x^ZZcxb7KSk}uVT=S9oY z%PtX=X}#sw9}*HoG2C~#R&aF|jRI%&nGE8Gd*iC|0c2LqRTg5y-^IRB2-B>}j?Z4I z{ipy6F=SXg6ZEZvxY^-^8#trGz6+QWMH6gJ?4f6vRmNW{mk3Z=Qt&=uW3*Yh6EUz# z*AEo8*|=}1g%)F-_N{swFb?yEz8a&mvu3#jhLG9`^_^_s?;y3iBv9>qFB2R|Kd1Vb zX7&N8uXCd3q)Etde%xJs=*zHqc15iFrKF=C<>`(^hrM`@1hGzyQ^BX>@CbvgPt%{k zlg3x)Agp+%_z(pKJ0;4$QcQ#iibhdn7E?iymK;~-MO;yYbd`cTQ2rOyv%mdfW_edo zzD<4Hh-<-!PGZ5%!UaL1rf-tk^e2gd3joKrhNJd3M;bp*Wa_5pOEkUQcd`Al=KVWM zXd+*z0-qCJi*9o=&EUnVjPJdD8}wWCPh7Nq9uTZ5QoJTHs||){XG2EAFC$a##`j$s zkNh)eg=(Sr%fP5s4OfvhizuKU=Nl?l9x2qvsotw=W%ZPBUiIcke&VK4B)&vQs%ff? zzL4IcV#F-`l_Vh~4QVF7Y*j_gn9=SAx|(gE9G1J5MSAmF3Li~Sx{!G+1e({VW< zLtM%jh2i}2d?V&P9F6ubFf8u;=tEHEVz@o{M&r6t^4J2CFA3B~N? zIi)LN3jIDz0Y!TJfzKN%S*bY6nwVo+L@|35pZy)}@OKT_rGF&rqX$OZc?`prt+~Dp zS8vt_^gt!t=h`|%USX0?dC3Pop~8U# +
+ + + xsmall 6 + + + xsmall 6 + + +
+
diff --git a/skyux-spa-visual-tests/src/app/fluid-grid/fluid-grid.visual-spec.ts b/skyux-spa-visual-tests/src/app/fluid-grid/fluid-grid.visual-spec.ts index f92a59b63..0be11ed98 100644 --- a/skyux-spa-visual-tests/src/app/fluid-grid/fluid-grid.visual-spec.ts +++ b/skyux-spa-visual-tests/src/app/fluid-grid/fluid-grid.visual-spec.ts @@ -1,13 +1,13 @@ import { SkyVisualTest } from '../../../config/utils/visual-test-commands'; -describe('Fluid grid', () => { +fdescribe('Fluid grid', () => { - it('should display all columns on different rows when on a very small screen', () => { + it('should handle very small screens', () => { return SkyVisualTest.setupTest('fluid-grid', 600) .then(() => { return SkyVisualTest.compareScreenshot({ - screenshotName: 'fluid-grid-screensmallest-differentrows', - selector: '#screenshot-fluid-grid', + screenshotName: 'fluid-grid-screenxsmall', + selector: '#screenshot-fluid-grid-xsmall', checkAccessibility: true }); }); diff --git a/src/app/components/fluid-grid/fluid-grid-demo.component.html b/src/app/components/fluid-grid/fluid-grid-demo.component.html index 9ddaefb81..d2d331a35 100644 --- a/src/app/components/fluid-grid/fluid-grid-demo.component.html +++ b/src/app/components/fluid-grid/fluid-grid-demo.component.html @@ -141,11 +141,11 @@ - - small="8" medium="9" large="10" + + screenXSmall="6" small="8" medium="9" large="10" - - small="4" medium="3" large="2" + + screenXSmall="6" small="4" medium="3" large="2" diff --git a/src/app/components/fluid-grid/index.html b/src/app/components/fluid-grid/index.html index ea3602377..8612a7855 100644 --- a/src/app/components/fluid-grid/index.html +++ b/src/app/components/fluid-grid/index.html @@ -1,6 +1,6 @@ -The fluid grid component provides a responsive 12-column layout to organize content for all device sizes. The fluid grid consists of sky-row and sky-column tags. You place column elements in row elements, and then you can specify how much of the layout to use for each column element on small, medium, and large screens. For extra small screens (less than 768px), the fluid grid automatically stacks columns vertically across the entire 12-column layout. +The fluid grid component provides a responsive 12-column layout to organize content for all device sizes. The fluid grid consists of sky-row and sky-column tags. You place column elements in row elements, and then you can specify how much of the layout to use for each column element on extra-small, small, medium, and large screens. @@ -10,8 +10,11 @@ + + Specifies the number of columns (1-12) to use for the element on extra-small screens (less than 768px). If you do not specify a value, the fluid grid displays the column at 100% width. + - Specifies the number of columns (1-12) to use for the element on small screens (768-991px). If you do not specify a value, the fluid grid displays the element vertically across the entire layout. + Specifies the number of columns (1-12) to use for the element on small screens (768-991px). If you do not specify a value, the element inherits the screenXSmall value. Specifies the number of columns (1-12) to use for the element on medium screens (992-1199px). If you do not specify a value, the element inherits the screenSmall value. diff --git a/src/modules/fluid-grid/column.component.scss b/src/modules/fluid-grid/column.component.scss index 64b93b2cd..33fd6a8c3 100644 --- a/src/modules/fluid-grid/column.component.scss +++ b/src/modules/fluid-grid/column.component.scss @@ -8,6 +8,8 @@ min-height: 1px; } +@include create_columns(xs); + @media (min-width: $sky-screen-sm-min) { @include create_columns(sm); } diff --git a/src/modules/fluid-grid/column.component.spec.ts b/src/modules/fluid-grid/column.component.spec.ts index b503fb6f2..4fd500b03 100644 --- a/src/modules/fluid-grid/column.component.spec.ts +++ b/src/modules/fluid-grid/column.component.spec.ts @@ -28,10 +28,12 @@ describe('SkyColumnComponent', () => { }); it('should add a class for small, medium, and large breakpoints', () => { + component.screenXSmall = 1; component.screenSmall = 1; component.screenMedium = 2; component.screenLarge = 5; fixture.detectChanges(); + expect(element.className).toContain('sky-column-xs-1'); expect(element.className).toContain('sky-column-sm-1'); expect(element.className).toContain('sky-column-md-2'); expect(element.className).toContain('sky-column-lg-5'); diff --git a/src/modules/fluid-grid/column.component.ts b/src/modules/fluid-grid/column.component.ts index 9c3c7c724..7fc870710 100644 --- a/src/modules/fluid-grid/column.component.ts +++ b/src/modules/fluid-grid/column.component.ts @@ -11,6 +11,9 @@ import { styleUrls: ['./column.component.scss'] }) export class SkyColumnComponent implements OnInit { + @Input() + public screenXSmall: number; + @Input() public screenSmall: number; @@ -28,6 +31,10 @@ export class SkyColumnComponent implements OnInit { 'sky-column' ]; + if (this.screenXSmall) { + classnames.push(`sky-column-xs-${this.screenXSmall}`); + } + if (this.screenSmall) { classnames.push(`sky-column-sm-${this.screenSmall}`); }