Skip to content

Commit

Permalink
Merge pull request #424 from jamesalley/new-menu
Browse files Browse the repository at this point in the history
New Menu
  • Loading branch information
jamesalley committed Feb 2, 2015
2 parents 6e32804 + 07e4869 commit 325a3b7
Show file tree
Hide file tree
Showing 16 changed files with 434 additions and 426 deletions.
15 changes: 6 additions & 9 deletions Gruntfile.js
Expand Up @@ -72,15 +72,12 @@ grunt.initConfig({
'build/grids-units.css'
]},

{'build/menus-nr.css': [
'build/menus-core.css',
'build/menus.css',
'build/menus-paginator.css'
]},

{'build/menus.css': [
'build/menus-nr.css',
'build/menus-r.css'
'build/menus-core.css',
'build/menus-horizontal.css',
'build/menus-dropdown.css',
'build/menus-scrollable.css',
'build/menus-skin.css',
]},

// Rollups
Expand All @@ -99,7 +96,7 @@ grunt.initConfig({
'build/grids.css',
'build/buttons.css',
'build/forms-nr.css',
'build/menus-nr.css',
'build/menus.css',
'build/tables.css'
]}
]
Expand Down
26 changes: 25 additions & 1 deletion HISTORY.md
@@ -1,8 +1,32 @@
Pure Change History
===================

0.6.0 (2015-02-07)
------------------

* Upgraded Normalize.css to 3.0.2.

* Dropped IE7 support.

* Refactored Menus.

### Menus

* Upgraded Normalize.css to 3.0.1.
* Implemented flatter, low-specificity selectors, not attached to HTML elements,
for easier customization.
* Removed pure-menu-open class.
* Added pure-menu-scrollable capability, to allow for scrollable menus when
restricted by width or height.
* Added pure-menu-allow-hover to reveal dropdowns on hover.
* Removed various default styling properties, making menus a bit more bare-bones,
a bit less opinionated, a bit easier to customize on top.
* Broke Menu up into files for core, horizontal, dropdowns, scrollable, and skin,
again for improved optimization and ease of customization: take only what you
need.
* Removed Paginator.
* While not part of the Pure repo itself, the accompanying Pure website now
features additional menu examples and an example script for enabling dropdowns
and improved accessiblity.

0.5.0 (2014-05-27)
------------------
Expand Down
3 changes: 2 additions & 1 deletion bower.json
@@ -1,6 +1,7 @@
{
"name": "pure",
"version": "0.5.0",
"description": "Use Pure's ridiculously tiny CSS to start any web project.",
"version": "0.6.0",
"main": "build/pure.css",
"devDependencies": {
"normalize-css": "^3.0"
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "pure",
"version": "0.5.0",
"version": "0.6.0",
"private": true,
"repository": "git://github.com/yahoo/pure.git",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/base/css/base.css
Expand Up @@ -12,6 +12,7 @@
* Always hide an element when it has the `hidden` HTML attribute.
*/

.hidden,
[hidden] {
display: none !important;
}
Expand Down
1 change: 1 addition & 0 deletions src/buttons/css/buttons.css
Expand Up @@ -32,6 +32,7 @@
.pure-button-active,
.pure-button:active {
box-shadow: 0 0 0 1px rgba(0,0,0, 0.15) inset, 0 0 6px rgba(0,0,0, 0.20) inset;
border-color: #000\9;
}

.pure-button[disabled],
Expand Down
16 changes: 12 additions & 4 deletions src/forms/css/forms.css
@@ -1,3 +1,11 @@
/*csslint box-model:false*/
/*
Box-model set to false because we're setting a height on select elements, which
also have border and padding. This is done because some browsers don't render
the padding. We explicitly set the box-model for select elements to border-box,
so we can ignore the csslint warning.
*/

.pure-form input[type="text"],
.pure-form input[type="password"],
.pure-form input[type="email"],
Expand Down Expand Up @@ -64,7 +72,6 @@ since IE8 won't execute CSS that contains a CSS3 selector.
.pure-form select:focus,
.pure-form textarea:focus {
outline: 0;
outline: thin dotted \9; /* IE6-9 */
border-color: #129FEA;
}

Expand All @@ -74,14 +81,13 @@ since IE8 won't execute CSS that contains a CSS3 selector.
*/
.pure-form input:not([type]):focus {
outline: 0;
outline: thin dotted \9; /* IE6-9 */
border-color: #129FEA;
}

.pure-form input[type="file"]:focus,
.pure-form input[type="radio"]:focus,
.pure-form input[type="checkbox"]:focus {
outline: thin dotted #333;
outline: thin solid #129FEA;
outline: 1px auto #129FEA;
}
.pure-form .pure-checkbox,
Expand Down Expand Up @@ -140,6 +146,8 @@ since IE8 won't execute CSS that contains a CSS3 selector.
outline-color: #e9322d;
}
.pure-form select {
/* Normalizes the height; padding is not sufficient. */
height: 2.15em;
border: 1px solid #ccc;
background-color: white;
}
Expand Down Expand Up @@ -219,7 +227,7 @@ since IE8 won't execute CSS that contains a CSS3 selector.
margin: 0 1em 0 0;
}
.pure-form-aligned .pure-controls {
margin: 1.5em 0 0 10em;
margin: 1.5em 0 0 11em;
}

/* Rounded Inputs */
Expand Down
141 changes: 21 additions & 120 deletions src/menus/css/menus-core.css
@@ -1,136 +1,37 @@
/*csslint adjoining-classes:false, outline-none:false*/
/*TODO: Remove this lint rule override after a refactor of this code.*/
/*csslint adjoining-classes: false, box-model:false*/
.pure-menu {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

.pure-menu ul {
position: absolute;
visibility: hidden;
.pure-menu-fixed {
position: fixed;
left: 0;
top: 0;
z-index: 3;
}

.pure-menu.pure-menu-open {
visibility: visible;
z-index: 2;
width: 100%;
.pure-menu-list,
.pure-menu-item {
position: relative;
}

.pure-menu ul {
left: -10000px;
.pure-menu-list {
list-style: none;
margin: 0;
padding: 0;
top: -10000px;
z-index: 1;
}

.pure-menu > ul { position: relative; }

.pure-menu-open > ul {
left: 0;
top: 0;
visibility: visible;
}

.pure-menu-open > ul:focus {
outline: 0;
.pure-menu-item {
padding: 0;
margin: 0;
height: 100%;
}

.pure-menu li { position: relative; }

.pure-menu a,
.pure-menu .pure-menu-heading {
.pure-menu-link,
.pure-menu-heading {
display: block;
color: inherit;
line-height: 1.5em;
padding: 5px 20px;
text-decoration: none;
white-space: nowrap;
}

.pure-menu.pure-menu-horizontal > .pure-menu-heading {
display: inline-block;
*display: inline;
zoom: 1;
margin: 0;
vertical-align: middle;
}
.pure-menu.pure-menu-horizontal > ul {
display: inline-block;
*display: inline;
zoom: 1;
vertical-align: middle;
}

.pure-menu li a { padding: 5px 20px; }

.pure-menu-can-have-children > .pure-menu-label:after {
content: '\25B8';
float: right;
/* These specific fonts have the Unicode char we need. */
font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', sans-serif;
margin-right: -20px;
margin-top: -1px;
}

.pure-menu-can-have-children > .pure-menu-label {
padding-right: 30px;
}

.pure-menu-separator {
background-color: #dfdfdf;
display: block;
height: 1px;
font-size: 0;
margin: 7px 2px;
overflow: hidden;
}

.pure-menu-hidden {
display: none;
}

/* FIXED MENU */
.pure-menu-fixed {
position: fixed;
top: 0;
left: 0;
width: 100%;
}


/* HORIZONTAL MENU CODE */

/* Initial menus should be inline-block so that they are horizontal */
.pure-menu-horizontal li {
display: inline-block;
*display: inline;
zoom: 1;
vertical-align: middle;
}

/* Submenus should still be display: block; */
.pure-menu-horizontal li li {
display: block;
}

/* Content after should be down arrow */
.pure-menu-horizontal > .pure-menu-children > .pure-menu-can-have-children > .pure-menu-label:after {
content: "\25BE";
}
/*Add extra padding to elements that have the arrow so that the hover looks nice */
.pure-menu-horizontal > .pure-menu-children > .pure-menu-can-have-children > .pure-menu-label {
padding-right: 30px;
}

/* Adjusting separator for vertical menus */
.pure-menu-horizontal li.pure-menu-separator {
height: 50%;
width: 1px;
margin: 0 7px;
}

/* Submenus should be horizontal separator again */
.pure-menu-horizontal li li.pure-menu-separator {
height: 1px;
width: auto;
margin: 7px 2px;
}

38 changes: 38 additions & 0 deletions src/menus/css/menus-dropdown.css
@@ -0,0 +1,38 @@
/* Submenus should still be display: block; */
.pure-menu-item .pure-menu-item {
display: block;
}

.pure-menu-children {
display: none;
position: absolute;
left: 100%;
top: 0;
margin: 0;
padding: 0;
z-index: 3;
}

.pure-menu-horizontal .pure-menu-children {
left: 0;
top: auto;
width: inherit;
}

.pure-menu-allow-hover:hover > .pure-menu-children,
.pure-menu-active > .pure-menu-children {
display: block;
position: absolute;
}

/* Vertical Menus - show the dropdown arrow */
.pure-menu-has-children > .pure-menu-link:after {
padding-left: 0.5em;
content: "\25B8";
font-size: small;
}

/* Horizontal Menus - show the dropdown arrow */
.pure-menu-horizontal .pure-menu-has-children > .pure-menu-link:after {
content: "\25BE";
}
19 changes: 19 additions & 0 deletions src/menus/css/menus-horizontal.css
@@ -0,0 +1,19 @@
/* HORIZONTAL MENU */
.pure-menu-horizontal {
width: 100%;
white-space: nowrap;
}

.pure-menu-horizontal .pure-menu-list {
display: inline-block;
}

/* Initial menus should be inline-block so that they are horizontal */
.pure-menu-horizontal .pure-menu-item,
.pure-menu-horizontal .pure-menu-heading,
.pure-menu-horizontal .pure-menu-separator {
display: inline-block;
*display: inline;
zoom: 1;
vertical-align: middle;
}

0 comments on commit 325a3b7

Please sign in to comment.