Browse Source

Update examples, fixes

pull/2034/head
jlukic 9 years ago
parent
commit
c2b16c2d3e
10 changed files with 210 additions and 207 deletions
  1. 2
      RELEASE-NOTES.md
  2. 42
      dist/components/grid.css
  3. 2
      dist/components/grid.min.css
  4. 42
      dist/semantic.css
  5. 2
      dist/semantic.min.css
  6. 272
      examples/grid.html
  7. 19
      src/definitions/collections/grid.less
  8. 10
      src/definitions/elements/container.less
  9. 4
      src/themes/default/collections/grid.variables
  10. 22
      src/themes/default/elements/container.variables

2
RELEASE-NOTES.md

@ -5,7 +5,7 @@
**New UI**
- **Container** - Containers are fixed width containers meant for holding page contents, and are a simpler alternative to `ui page grid`, view more [examples in docs](http://www.semantic-ui.com/elements/container.html#examples)
- **Multiselect** - New dropdown component has been added for multi-select
- **Grid** - `equal height` and `equal width` grids, which use `flexbox` are now recommended for usage. Works correctly with or without `row` wrapper, and support vertical alignment including `stretch` alignment for matching child element heights.
- **Grid** - Grids are now based on `flexbox`, columns are now `equal height` by default. Flexbox alignment has been added for easier vertical alignment.
- **Headers** - Added new header type `sub header`, useful for displaying small headers alongside text content. See examples [in the header docs](http://www.semantic-ui.com/elements/header.html#sub-headers)
**Major Changes**

42
dist/components/grid.css

@ -27,10 +27,10 @@
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-align: start;
-webkit-align-items: flex-start;
-ms-flex-align: start;
align-items: flex-start;
-webkit-box-align: stretch;
-webkit-align-items: stretch;
-ms-flex-align: stretch;
align-items: stretch;
padding: 0em;
}
@ -40,7 +40,7 @@
.ui.grid {
margin-top: -1rem;
margin-bottom: 0em;
margin-bottom: -1rem;
margin-left: -1rem;
margin-right: -1rem;
}
@ -96,10 +96,10 @@
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-align: start;
-webkit-align-items: flex-start;
-ms-flex-align: start;
align-items: flex-start;
-webkit-box-align: stretch;
-webkit-align-items: stretch;
-ms-flex-align: stretch;
align-items: stretch;
width: 100% !important;
padding: 0rem;
padding-top: 1rem;
@ -193,8 +193,8 @@ body > .ui.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 4em;
padding-right: 4em;
padding-left: 8%;
padding-right: 8%;
}
}
@media only screen and (min-width: 992px) and (max-width: 1399px) {
@ -211,8 +211,8 @@ body > .ui.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 18%;
padding-right: 18%;
padding-left: 15%;
padding-right: 15%;
}
}
@media only screen and (min-width: 1920px) {
@ -1035,11 +1035,9 @@ body > .ui.grid {
-----------------------*/
.ui.grid [class*="left floated"].column {
float: left;
margin-right: auto;
}
.ui.grid [class*="right floated"].column {
float: right;
margin-left: auto;
}
@ -1470,20 +1468,6 @@ body > .ui.grid {
padding-bottom: 1rem;
}
/*----------------------
Equal Height
-----------------------*/
.ui[class*="equal height"].grid > .column:not(.row),
.ui[class*="equal height"].grid > .row > .column,
.ui.grid > [class*="equal height"].row > .column {
display: inline-block;
-webkit-box-flex: 0;
-webkit-flex-grow: 0;
-ms-flex-positive: 0;
flex-grow: 0;
}
/*----------------------
Equal Width
-----------------------*/

2
dist/components/grid.min.css
File diff suppressed because it is too large
View File

42
dist/semantic.css

@ -14791,10 +14791,10 @@ ol.ui.horizontal.list li:before,
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-align: start;
-webkit-align-items: flex-start;
-ms-flex-align: start;
align-items: flex-start;
-webkit-box-align: stretch;
-webkit-align-items: stretch;
-ms-flex-align: stretch;
align-items: stretch;
padding: 0em;
}
@ -14804,7 +14804,7 @@ ol.ui.horizontal.list li:before,
.ui.grid {
margin-top: -1rem;
margin-bottom: 0em;
margin-bottom: -1rem;
margin-left: -1rem;
margin-right: -1rem;
}
@ -14864,10 +14864,10 @@ ol.ui.horizontal.list li:before,
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-align: start;
-webkit-align-items: flex-start;
-ms-flex-align: start;
align-items: flex-start;
-webkit-box-align: stretch;
-webkit-align-items: stretch;
-ms-flex-align: stretch;
align-items: stretch;
width: 100% !important;
padding: 0rem;
padding-top: 1rem;
@ -14967,8 +14967,8 @@ body > .ui.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 4em;
padding-right: 4em;
padding-left: 8%;
padding-right: 8%;
}
}
@ -14987,8 +14987,8 @@ body > .ui.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 18%;
padding-right: 18%;
padding-left: 15%;
padding-right: 15%;
}
}
@ -15945,12 +15945,10 @@ body > .ui.grid {
-----------------------*/
.ui.grid [class*="left floated"].column {
float: left;
margin-right: auto;
}
.ui.grid [class*="right floated"].column {
float: right;
margin-left: auto;
}
@ -16432,20 +16430,6 @@ body > .ui.grid {
padding-bottom: 1rem;
}
/*----------------------
Equal Height
-----------------------*/
.ui[class*="equal height"].grid > .column:not(.row),
.ui[class*="equal height"].grid > .row > .column,
.ui.grid > [class*="equal height"].row > .column {
display: inline-block;
-webkit-box-flex: 0;
-webkit-flex-grow: 0;
-ms-flex-positive: 0;
flex-grow: 0;
}
/*----------------------
Equal Width
-----------------------*/

2
dist/semantic.min.css
File diff suppressed because it is too large
View File

272
examples/grid.html

@ -16,85 +16,43 @@
<link rel="stylesheet" type="text/css" href="../dist/components/divider.css">
<link rel="stylesheet" type="text/css" href="../dist/components/grid.css">
<link rel="stylesheet" type="text/css" href="../dist/components/header.css">
</head>
<body>
<style type="text/css">
/* Some basic formatting */
code {
background-color: #E0E0E0;
padding: 0.25em 0.3em;
font-family: 'Lato';
font-weight: bold;
}
.container {
padding: 5em 0em;
}
.ui.block.header,
.first {
margin-top: 5em;
}
.ui.block.header:first-child {
margin-top: 0em;
}
.ui.block.header {
margin-left: -4rem;
margin-right: -4rem;
padding-left: 4rem;
padding-right: 4rem;
}
h1,
h3 {
margin-top: 10em;
}
<div class="ui text container">
<h1 class="ui inverted block header">Using Grids</h1>
img {
display: block;
max-width: 100%;
}
img + img {
margin-top: 0.5em;
}
<h3 class="first">Container</h3>
<p>A container is a fixed width element that wraps your site's content. It remains a constant size and uses <b>margin</b> to center. Containers are the simplest way to center page content inside a grid.</code>
</p>
</div>
/* Shows content box (not negative margins) */
.grid {
position: relative;
}
.grid:before {
position: absolute;
top: 1rem;
left: 1rem;
background-color: #F0F0F0;
content: '';
width: calc(100% - 2rem);
height: calc(100% - 2rem);
box-shadow: 0px 0px 0px 1px #DDDDDD inset;
}
.ui.divided.grid:before,
.celled.grid:before {
display: none;
}
.ui.aligned .column:after {
display: none !important;
}
.grid .column:not(.row):not(.grid):after {
background-color: rgba(86,61,124,.15);
box-shadow: 0px 0px 0px 1px rgba(86,61,124,.2) inset;
content: "";
display: block;
min-height: 50px;
}
</style>
<div class="ui container">
<div class="ui grid">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
</div>
</head>
<body>
<div class="ui text container">
<h1 class="ui inverted block header">Top Level Grids</h1>
<h3 class="first">Page Grid</h3>
<p>A <code>ui page grid</code> uses <code>padding</code> to maintain fluid page gutters. Each columns width will continuously adjust as your browser width changes to maintain the same percentage of overall browser width</p>
<p>Page grids work best for wide multi-column pages like homepages.</p>
<h3>Page Grid</h3>
<p>A <code>page grid</code> uses <code>padding</code> to create fluid page gutters. Each columns width will continuously adjust as your browser width changes to maintain the same percentage of overall browser width.</p>
<p>A page grid adjusts its gutters as a percentage of total page width for each device. This causes it to snap to a new width on each breakpoint.</p>
</div>
<div class="ui page grid">
@ -117,42 +75,22 @@
</div>
<div class="ui text container">
<h3 class="first">Container</h3>
<p>A container is a fixed width element that wraps your site's content. It is not fluid in size and uses <b>margin</b> to center. Containers work best for centered content that is placed inside a containing box like a <code>ui segment</code>
</p>
<h3 class="first">Text Container</h3>
<p>Sometimes you just need to put a single column of centered text on a page. A <code>text container</code> is a special type of container optimized for a single flowing column of text, like this instructions on this page.
</p>
<p>Text containers <b>do not need to use grids</b> and help simplify basic page layouts.</p>
</div>
<div class="ui container">
<div class="ui grid">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="ui text container">
<div class="ui one column grid">
<div class="column"></div>
</div>
</div>
<div class="ui text container">
<h3 class="first">Text Container</h3>
<p>Sometimes you just need to put a single column of centered text on a page. A <code>ui text container</code> is a special type of container designed to optimize for a single flowing column of text, like this instructions on this page.
</p>
<p>Text containers <b>do not need to use grids</b> and help simplify basic page layouts.</p.
</div>
<div class="ui text container">
<h1 class="ui inverted block header">Setting Up Grids</h1>
<h1 class="ui inverted block header">Grid Content</h1>
<h3 class="first">Column Flow</h3>
<p>A grid does not necessarily need to specify rows. If you include <code>columns</code> as direct child of <code>ui grid</code> content will automatically flow to the next row when all the grid columns are taken in the current row</b>.</p>
@ -169,19 +107,15 @@
</div>
<h3>Clearing Rows</h3>
<p>Adding row wrappers allow you to manually specify you want a new row to begin. This can be useful when centering content with a <code>ui centered grid</code>.</p>
<p>Adding row wrappers allow you to manually specify you want a new row to begin.</p>
<div class="ui centered grid">
<div class="four wide column"></div>
<div class="four wide column"></div>
<div class="four wide column"></div>
<div class="ui three column grid">
<div class="column"></div>
<div class="row">
<div class="four wide column"></div>
<div class="four wide column"></div>
<div class="four wide column"></div>
<div class="four wide column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
<div class="four wide column"></div>
</div>
@ -361,11 +295,45 @@
<div class="four wide column">four wide column</div>
</div>
<h1>Responsive Patterns</h1>
<h3>Doubling</h3>
<p>You can set columns to double in width at each device jump</p>
<div class="ui five column doubling grid">
<div class="column">column</div>
<div class="column">column</div>
<div class="column">column</div>
<div class="column">column</div>
<div class="column">column</div>
</div>
<h3>Stackable</h3>
<p>You can set columns to stack on mobile</p>
<div class="ui three column stackable grid">
<div class="column">column</div>
<div class="column">column</div>
<div class="column">column</div>
</div>
<h3>Responsive Width Adjustments</h3>
<p>You can specify columns to appear at different widths on different screens</p>
<div class="ui grid">
<div class="eight wide mobile six wide tablet four wide computer column"></div>
<div class="eight wide mobile six wide tablet four wide computer column"></div>
<div class="eight wide mobile six wide tablet four wide computer column"></div>
<div class="eight wide mobile six wide tablet four wide computer column"></div>
<div class="eight wide mobile six wide tablet four wide computer column"></div>
</div>
<div class="ui grid">
<div class="four wide two wide large screen one wide widescreen column"></div>
<div class="four wide two wide large screen one wide widescreen column"></div>
<div class="four wide two wide large screen one wide widescreen column"></div>
<div class="four wide two wide large screen one wide widescreen column"></div>
</div>
<h3>Specifying Device Visibility</h3>
<p>The Semantic grid system has three tiers of classes: mobile (phones), tablet (tablets), computer (desktops and larger desktops) You can use nearly any combination of these classes to create more dynamic and flexible layouts</p>
<p>Breakpoints are 768px and below for mobile, 768-992px for tablet and 992px+ for computer</p>
<p>In these cases below, we'd like to recommend you to change size of your viewport or use right devices for responsiveness experience</p>
<p>You can specify columns to appear only a particular screen</p>
<div class="ui grid">
<div class="two column computer only row">
<div class="ten wide column">ten wide column computer only</div>
@ -386,8 +354,86 @@
<div class="column">column</div>
</div>
</div>
</div>
</div>
<style type="text/css">
/* Some basic formatting */
code {
background-color: #E0E0E0;
padding: 0.25em 0.3em;
font-family: 'Lato';
font-weight: bold;
}
.container {
padding: 5em 0em;
}
.ui.block.header,
.first {
margin-top: 5em;
}
.ui.block.header:first-child {
margin-top: 0em;
}
.ui.block.header {
margin-left: -4rem;
margin-right: -4rem;
padding-left: 4rem;
padding-right: 4rem;
}
h1,
h3 {
margin-top: 10em;
}
img {
display: block;
max-width: 100%;
}
img + img {
margin-top: 0.5em;
}
/* Shows content box (not negative margins) */
.grid {
position: relative;
}
.grid:before {
position: absolute;
top: 1rem;
left: 1rem;
background-color: #F0F0F0;
content: '';
width: calc(100% - 2rem);
height: calc(100% - 2rem);
box-shadow: 0px 0px 0px 1px #DDDDDD inset;
}
.ui.divided.grid:before,
.celled.grid:before {
display: none;
}
.ui.aligned .column:after {
display: none !important;
}
.grid .column:not(.row):not(.grid):after {
background-color: rgba(86, 61, 124, .15);
box-shadow: 0px 0px 0px 1px rgba(86, 61, 124, 0.2) inset;
content: "";
display: block;
min-height: 50px;
}
@media only screen and (max-width: 768px) {
.stackable.grid:before {
width: 100%;
left: 0em;
}
}
</style>
</body>
</html>

19
src/definitions/collections/grid.less

@ -26,7 +26,7 @@
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: flex-start;
align-items: stretch;
padding: 0em;
}
@ -36,7 +36,7 @@
.ui.grid {
margin-top: -(@rowSpacing / 2);
margin-bottom: 0em;
margin-bottom: -(@rowSpacing / 2);
margin-left: -(@gutterWidth / 2);
margin-right: -(@gutterWidth / 2);
}
@ -85,7 +85,7 @@
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: flex-start;
align-items: stretch;
width: 100% !important;
padding: 0rem;
padding-top: (@rowSpacing / 2);
@ -1016,11 +1016,9 @@ body > .ui.grid {
-----------------------*/
.ui.grid [class*="left floated"].column {
float: left;
margin-right: auto;
}
.ui.grid [class*="right floated"].column {
float: right;
margin-left: auto;
}
@ -1409,17 +1407,6 @@ body > .ui.grid {
padding-bottom: (@rowSpacing / 2);
}
/*----------------------
Equal Height
-----------------------*/
.ui[class*="equal height"].grid > .column:not(.row),
.ui[class*="equal height"].grid > .row > .column,
.ui.grid > [class*="equal height"].row > .column {
display: inline-block;
flex-grow: 0;
}
/*----------------------
Equal Width
-----------------------*/

10
src/definitions/elements/container.less

@ -44,18 +44,18 @@
margin-right: @tabletGutter !important;
}
}
@media only screen and (min-width: @smallComputerBreakpoint) and (max-width: @largeComputerBreakpoint) {
@media only screen and (min-width: @smallComputerBreakpoint) and (max-width: @largeMonitorBreakpoint) {
.ui.container {
width: @smallComputerWidth;
margin-left: @smallComputerGutter !important;
margin-right: @smallComputerGutter !important;
}
}
@media only screen and (min-width: @largeComputerBreakpoint) {
@media only screen and (min-width: @largeMonitorBreakpoint) {
.ui.container {
width: @largeComputerWidth;
margin-left: @largeComputerGutter !important;
margin-right: @largeComputerGutter !important;
width: @largeMWidth;
margin-left: @largeMGutter !important;
margin-right: @largeMGutter !important;
}
}

4
src/themes/default/collections/grid.variables

@ -37,7 +37,7 @@
@tabletWidth: auto;
@tabletMargin: 0em;
@tabletGutter: 4em;
@tabletGutter: 8%;
@computerWidth: auto;
@computerMargin: 0em;
@ -45,7 +45,7 @@
@largeMonitorWidth: auto;
@largeMonitorMargin: 0em;
@largeMonitorGutter: 18%;
@largeMonitorGutter: 15%;
@widescreenMonitorWidth: auto;
@widescreenMargin: 0em;

22
src/themes/default/elements/container.variables

@ -10,20 +10,22 @@
/* Devices */
@mobileWidth: auto;
@tabletWidth: 752px;
@smallComputerWidth: 960px;
@largeComputerWidth: 1120px;
@mobileGutter: 1em;
@largestMobileScreen: 780px;
@tabletWidth: 752px;
@tabletBreakpoint: 781px;
@tabletGutter: auto;
@smallComputerGutter: auto;
@largeComputerGutter: auto;
@smallMonitorBreakpoint: 988px;
@smallMonitorWidth: 960px;
@smallMonitorGutter: auto;
@largeMonitorWidth: 1120px;
@largeMonitorBreakpoint: 1148px;
@largeMonitorGutter: auto;
/* Adjust breakpoints to match fixed width */
@largestMobileScreen: 780px;
@tabletBreakpoint: 781px;
@smallComputerBreakpoint: 988px;
@largeComputerBreakpoint: 1148px;
/*-------------------
Types

Loading…
Cancel
Save