It's straightforward to take the standard grids and make them responsive by stacking the grid blocks at narrow widths. Since we just want to override the floats and widths of the standard grid styles below a single breakpoint, use a max-width breakpoint to only apply the stacked styling as an override.
-
We recommend adding a class (ex: my-breakpoint) to scope the styles for the media query so it can be applied selectively. From this basic start, you can customize the appearance further or even add additional breakpoints. See an example of a custom responsive grid.
+
We recommend adding a class (ex: my-breakpoint) to scope the styles for the media query so it can be applied selectively. From this basic start, you can customize the appearance further or even add additional breakpoints. See an example of a custom responsive grid.
From d1f42ca534e5335f2a2d3c2729fd3dddb762421c Mon Sep 17 00:00:00 2001
From: Jasper de Groot
Date: Thu, 21 Feb 2013 11:50:15 +0100
Subject: [PATCH 09/38] Demos: added collapsing border styling to custom
responsive grid example
---
docs/widgets/grids/grid-custom.php | 243 ++++++++++++++++-------------
1 file changed, 133 insertions(+), 110 deletions(-)
diff --git a/docs/widgets/grids/grid-custom.php b/docs/widgets/grids/grid-custom.php
index 0435c80bd8e..6bc33fcfc33 100644
--- a/docs/widgets/grids/grid-custom.php
+++ b/docs/widgets/grids/grid-custom.php
@@ -14,76 +14,96 @@
@@ -98,53 +118,56 @@
-
Custom responsive grid
-
-
It's easy to extend the basic grid styles into a custom responsive layout by using CSS media queries to adjust the layout and design across various screen width breakpoints.
-
This example is a typical news feature block that changes its layout across screen widths and illustrates how to change the grid ratios and overall layout with simple CSS. It starts as a simple set of stacked stories on phones, that goes to a layout with the lead story full width stacked over a 50/50 layout of the secondary stories. At wider widths, these secondary stories float next to the lead story in a 50/25/25 layout. When the screen gets very wide, the font size is bumped up to keep line lengths short.
-
Use the view source button below to see how the media queries work for each of these breakpoints.
-
-
-
-
-
-
-
-
-
-
Apple schedules 'iPad Mini' event for October 23
-
One of the worst-kept secrets in tech has been confirmed: Apple will hold an event October 23 in San Jose, California, at which the company is widely expected to unveil a smaller, cheaper version of its popular iPad called "Mini".
-
-
-
-
-
-
-
Microsoft Surface tablet goes on sale for $499
-
The Microsoft Surface tablet picture has come into focus. The Redmond giant filled in the blanks on the new tablet's availability and specs.
-
-
-
-
-
-
-
AOL unveils Alto, an email service that syncs 5 accounts
-
AOL, struggling to shed its outdated image, is reimagining one of the most visibly aging parts of its platform: Its email service.
-
-
-
-
-
-
-
-
-
-
-
-
+
Custom responsive grid
+
+
It's easy to extend the basic grid styles into a custom responsive layout by using CSS media queries to adjust the layout and design across various screen width breakpoints.
+
+
This example is a typical news feature block that changes its layout across screen widths and illustrates how to change the grid ratios and overall layout with simple CSS. It starts as a simple set of stacked stories on phones, that goes to a layout with the lead story full width stacked over a 50/50 layout of the secondary stories. At wider widths, these secondary stories float next to the lead story in a 50/25/25 layout. When the screen gets very wide, the font size is bumped up to keep line lengths short.
+
Use the view source button below to see how the media queries work for each of these breakpoints.
+
+
+
+
+
+
+
+
+
+
Apple schedules 'iPad Mini' event for October 23
+
One of the worst-kept secrets in tech has been confirmed: Apple will hold an event October 23 in San Jose, California, at which the company is widely expected to unveil a smaller, cheaper version of its popular iPad called "Mini".
+
+
+
+
+
+
+
Microsoft Surface tablet goes on sale for $499
+
The Microsoft Surface tablet picture has come into focus. The Redmond giant filled in the blanks on the new tablet's availability and specs.
+
+
+
+
+
+
+
AOL unveils Alto, an email service that syncs 5 accounts
+
AOL, struggling to shed its outdated image, is reimagining one of the most visibly aging parts of its platform: Its email service.
From 0578fa09d17363c3e1f4a67073c765a3f9454a80 Mon Sep 17 00:00:00 2001
From: Jasper de Groot
Date: Thu, 21 Feb 2013 15:48:19 +0100
Subject: [PATCH 11/38] Demos: copy editing of panel styling demo.
---
docs/examples/panels/panel-styling.php | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/docs/examples/panels/panel-styling.php b/docs/examples/panels/panel-styling.php
index 2c3ddc1a05b..092a846c77e 100644
--- a/docs/examples/panels/panel-styling.php
+++ b/docs/examples/panels/panel-styling.php
@@ -71,9 +71,9 @@
box-shadow: -5px 0px 5px rgba(0,0,0,.15);
}
- /* Use the ui-body class of your page theme to set a background image.
- The page theme will be set for the content wrapper,
- while the page get the panel them before opening the panel. */
+ /* Use the ui-body class of your page theme (ui-body-d in this demo) to set a background image.
+ This class will be added to the content wrapper, while the page itself gets the same background
+ as the panel before opening the panel. */
#demo-page .ui-body-d {
background-image: url(../../_assets/img/bg-pattern.png);
background-repeat: repeat-x;
@@ -148,6 +148,8 @@
Set a background image for a page that contains a panel.
Give the page a responsive layout with CSS columns.
+
+
Click the "view source" button to see the CSS and markup of this demo and open the demo to see the result.
Open demo
From 27095c3ce92c31b389d76088da9d6cc8f61a80e7 Mon Sep 17 00:00:00 2001
From: Jasper de Groot
Date: Thu, 21 Feb 2013 17:28:44 +0100
Subject: [PATCH 12/38] Demos: made menu title match page title
---
docs/nav-widgets.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/nav-widgets.php b/docs/nav-widgets.php
index 0adbe7a8bff..40c73cf8a73 100644
--- a/docs/nav-widgets.php
+++ b/docs/nav-widgets.php
@@ -26,7 +26,7 @@
It's not recommended to have many buttons with text on one row at small screens, because the text might get truncated. You can use responsive grids to stack the buttons at small screens. Here we use the framework preset breakpoint by adding class ui-responsive to the container.
The other grid layout configuration uses class=ui-grid-b on the parent, and 3 child container elements, each with its respective ui-block-a/b/c class, to create a three-column layout (33/33/33%).
A five-column, 20/20/20/20/20% grid is created by specifying class=ui-grid-d on the parent and adding a fifth block.
-
-
A
-
B
-
C
-
D
-
E
-
+
+
A
+
B
+
C
+
D
+
E
+
+
Multiple row grids
Grids are designed to wrap to multiple rows of items. For example, if you specify a 3-column grid (ui-grid-b) on a container that has nine child blocks, it will wrap to 3 rows of 3 items each. There is a CSS rule to clear the floats and start a new line when the class=ui-block-a is seen so make sure to assign block classes in a repeating sequence (a, b, c, a, b, c, etc.) that maps to the grid type:
-
-
A
-
B
-
C
-
A
-
B
-
C
-
A
-
B
-
C
-
+
+
A
+
B
+
C
+
A
+
B
+
C
+
A
+
B
+
C
+
+
Grid solo class
-
Please note that the framework adds left and right margin to buttons in a grid. For a single button you can use a container with class ui-grid-solo and wrap the button in a div with class ui-block-a like the example below. This way the button will get the same margin.
+
+
The framework adds left and right margin to buttons in a grid. For a single button you can use a container with class ui-grid-solo and wrap the button in a div with class ui-block-a like the example below. This way the button will get the same margin. View more examples of buttons in grids.
The panel will be displayed with the position:absolute CSS property, meaning it will scroll with the page. When a panel is opened the framework checks to see if the bottom of the panel contents is in view. If not, it scrolls to the top of the page.
-
You can set a panel to position:fixed, so its contents will appear no matter how far down the page you're scrolled, by adding the data-position-fixed="true" attribute to the panel. The framework also checks to see if the panel contents will fit within the viewport before applying the fixed positioning because this property would prevent the panel contents from scrolling and using overflow is not well supported enough to use at this time. If the panel contents are too long to fit within the viewport, the framework will simply display the panel without absolute positioning.
You can set a panel to position:fixed, so its contents will appear no matter how far down the page you're scrolled, by adding the data-position-fixed="true" attribute to the panel. The framework also checks to see if the panel contents will fit within the viewport before applying the fixed positioning because this property would prevent the panel contents from scrolling and make it inaccessible. overflow is not well supported enough to use at this time. If the panel contents are too long to fit within the viewport, the framework will simply display the panel without fixed positioning. See an example of panels with fixed positioning.
Styling panels
@@ -168,9 +166,7 @@
Applying a preset breakpoint
-
Included in the widget styles is a breakpoint preset for this behavior that kicks in at 55em (880px). This breakpoint is not applied by default to make it easier for you to write custom breakpoints that work best for your content and design. To apply the breakpoint preset, add the ui-responsive-panel class to the page wrapper (not the panel).
Included in the widget styles is a breakpoint preset for this behavior that kicks in at 55em (880px). This breakpoint is not applied by default to make it easier for you to write custom breakpoints that work best for your content and design. To apply the breakpoint preset, add the ui-responsive-panel class to the page wrapper (not the panel). See an example of a responsive panel page.
This is a typical page that has two buttons in the header bar that open panels. The left button opens a left menu with the reveal display mode. The right button opens a form in a right overlay panel. We also set position fixed for the header and footer on this page.
+
This is a typical page that has two buttons in the header bar that open panels. The left panel has the reveal display mode. The right panel opens as overlay. For both panels we set data-position-fixed="true". We also set position fixed for the header and footer on this page.
-
The left panel contains a long menu to demonstrate that the framework will check the panel contents height and unfixes the panel so its content can be scrolled.
+
The left panel contains a long menu to demonstrate that the framework will check the panel contents height and unfixes the panel so its content can be scrolled. In the right panel there is a short form that shows the fixed positioning.
Responsive
-
To make this responsive, the panel stays open and causes the page to re-flow at wider widths. This allows both the menu and page to be used together when more space is available. This behavior is controlled by CSS media queries. You can create a custom one for a specific breakpoint or use the breakpoint preset by adding the class="ui-responsive-panel" to the page container. We have added this class on this demo page.
+
To make this responsive, you can make the page re-flow at wider widths. This allows both the reveal panel menu and page to be used together when more space is available. This behavior is controlled by CSS media queries. You can create a custom one for a specific breakpoint or use the breakpoint preset by adding the class="ui-responsive-panel" to the page container. We have added this class on this demo page.