From 4ab58d4e816bc5e998a936cc1ae5361f2dc46dfe Mon Sep 17 00:00:00 2001 From: SkyArrow Date: Wed, 25 Jan 2012 01:14:46 +0800 Subject: 2-level menu --- sass/base/_layout.scss | 4 +-- sass/parts/_header.scss | 52 ++++++++++++++++++++++++++++++-- source/_includes/custom/navigation.html | 18 +++++------ source/images/detail.png | Bin 0 -> 1135 bytes 4 files changed, 61 insertions(+), 13 deletions(-) create mode 100644 source/images/detail.png diff --git a/sass/base/_layout.scss b/sass/base/_layout.scss index 2f9586d..0ccdb0d 100644 --- a/sass/base/_layout.scss +++ b/sass/base/_layout.scss @@ -12,8 +12,8 @@ $max-width: 1000px; user-select: $select; } @mixin border-shadow($top: #fff, $bottom: #ddd){ - border-top: 1px solid #fff; - border-bottom: 1px solid #ddd; + border-top: 1px solid $top; + border-bottom: 1px solid $bottom; } *{ diff --git a/sass/parts/_header.scss b/sass/parts/_header.scss index 7c17a86..e792976 100644 --- a/sass/parts/_header.scss +++ b/sass/parts/_header.scss @@ -16,14 +16,62 @@ header{ } nav{ margin-left: 30px; - ul{ + >ul{ list-style: none; - li{ + padding-right: 30px; + >li{ float: left; margin-left: 50px; + position: relative; + >a{ + padding: 35px 30px 35px 0; + margin-top: -35px; + background: image-url('detail.png') right center no-repeat; + &:only-child{ + padding-right: 0; + background: none; + } + } } ul{ + position: absolute; + top: 60px; + left: 0; + z-index: 10; + white-space: nowrap; + background: #ddd; + border: 1px solid #ccc; + border-radius: 0 0 5px 5px; + box-shadow: 0 4px 8px #DDDDDD; + list-style: none; display: none; + li{ + @include border-shadow(#eee, #ccc); + &:hover{ + background: #d5d5d5; + } + &:first-of-type{ + border-top: none; + } + &:last-of-type{ + border-bottom: none; + } + a{ + display: block; + padding: 5px 15px; + width: 100%; + &:hover{ + color: #666; + } + } + } + } + li{ + &:hover{ + >ul{ + display: block; + } + } } } } diff --git a/source/_includes/custom/navigation.html b/source/_includes/custom/navigation.html index a572467..4027e4d 100644 --- a/source/_includes/custom/navigation.html +++ b/source/_includes/custom/navigation.html @@ -1,19 +1,19 @@ diff --git a/source/images/detail.png b/source/images/detail.png new file mode 100644 index 0000000..9093a61 Binary files /dev/null and b/source/images/detail.png differ -- cgit v1.1-2-g2b99