Add nav, Enhance tabs

This commit is contained in:
Jeremy Thomas
2016-05-07 23:40:06 +01:00
parent c0f0f9f9d8
commit 368ab78c38
10 changed files with 231 additions and 117 deletions

View File

@@ -101,4 +101,4 @@ $displays: 'block' 'flex' 'inline' 'inline-block' 'inline-flex'
margin: 0 !important margin: 0 !important
.is-unselectable .is-unselectable
+unselectable @extend .unselectable

View File

@@ -7,6 +7,7 @@
@import "menu" @import "menu"
@import "message" @import "message"
@import "modal" @import "modal"
@import "nav"
@import "navbar" @import "navbar"
@import "pagination" @import "pagination"
@import "panel" @import "panel"

104
sass/components/nav.sass Normal file
View File

@@ -0,0 +1,104 @@
.nav
align-items: stretch
background: $white
display: flex
min-height: $nav-height
position: relative
text-align: center
z-index: 2
& > .container
align-items: stretch
display: flex
min-height: $nav-height
width: 100%
+tablet
& > .container
& > .nav-left
margin-left: -10px
& > .nav-right
margin-left: -10px
.nav-toggle
@extend .hamburger
// Responsiveness
+tablet
display: none
// Elements
.nav-item
align-items: center
display: flex
justify-content: center
padding: 10px
a
flex-grow: 1
img
max-height: 24px
.button + .button
margin-left: 10px
.tag
&:first-child
margin-right: 5px
&:last-child
margin-left: 5px
// Responsiveness
+mobile
justify-content: flex-start
.nav-item a,
a.nav-item
color: $text
&:hover
color: $link-hover
// Modifiers
&.is-active
color: $link-active
.nav-tab
align-items: center
border-bottom: 1px solid transparent
color: $text
display: block
height: $nav-height
line-height: 24px
padding: 13px 15px
&:hover
border-bottom: 1px solid $link
// Modifiers
&.is-active
border-bottom: 3px solid $link
color: $link
// Containers
.nav-menu
// Responsiveness
+mobile
background: $white
box-shadow: 0 4px 7px rgba($black, 0.1)
left: 0
display: none
right: 0
top: 100%
position: absolute
.nav-item
border-top: 1px solid rgba($border, 0.5)
padding: 10px
// Modifiers
&.is-active
display: block
.nav-left
align-items: stretch
display: flex
flex: 1
overflow: hidden
overflow-x: auto
white-space: nowrap
.nav-right
align-items: stretch
// Responsiveness
+tablet
display: flex

View File

@@ -1,5 +1,9 @@
.tabs .tabs
@extend .block @extend .block
@extend .unselectable
align-items: stretch
display: flex
justify-content: space-between
line-height: 24px line-height: 24px
overflow: hidden overflow: hidden
overflow-x: auto overflow-x: auto
@@ -11,78 +15,70 @@
display: flex display: flex
justify-content: center justify-content: center
margin-bottom: -1px margin-bottom: -1px
padding: 5px 0 padding: 6px 12px
vertical-align: top vertical-align: top
&:hover &:hover
border-bottom-color: $text-strong border-bottom-color: $text-strong
color: $text-strong color: $text-strong
li li
display: block display: block
vertical-align: top
& + li
margin-left: 20px
// Modifiers
&.is-active &.is-active
a a
border-bottom-color: $link border-bottom-color: $link
color: $link color: $link
ul ul
align-items: center
border-bottom: 1px solid $border border-bottom: 1px solid $border
display: flex display: flex
flex: 1
justify-content: flex-start
&.is-left
padding-right: 10px
&.is-center
flex: none
justify-content: center
padding-left: 10px
padding-right: 10px
&.is-right
justify-content: flex-end
padding-left: 10px
.icon .icon
&:first-child &:first-child
margin-right: 5px margin-right: 8px
&:last-child &:last-child
margin-left: 5px margin-left: 8px
// Modifiers // Alignment
&.is-centered
ul
justify-content: center
&.is-right
ul
justify-content: flex-end
// Styles
&.is-boxed &.is-boxed
a a
border: 1px solid transparent border: 1px solid transparent
border-radius: $radius $radius 0 0 border-radius: $radius $radius 0 0
padding: 5px 15px padding-bottom: 5px
padding-top: 5px
&:hover &:hover
background: $background background: $background
border-bottom-color: $border border-bottom-color: $border
li li
& + li
margin-left: 5px
// Modifiers
&.is-active &.is-active
a a
background: $white background: $white
border-color: $border border-color: $border
border-bottom-color: transparent border-bottom-color: transparent
// Modifiers
&.is-centered
li
&,
& + li
margin: 0 2px
&.is-centered
a
padding: 5px 10px
li
& + li
margin-left: 0
ul
justify-content: center
text-align: center
&.is-fullwidth &.is-fullwidth
li li
flex: 1 flex: 1
& + li
margin-left: 0
ul
justify-content: center
text-align: center
&.is-right
ul
justify-content: flex-end
&.is-toggle &.is-toggle
a a
border: 1px solid $border border: 1px solid $border
margin-bottom: 0 margin-bottom: 0
padding: 5px 10px padding-bottom: 5px
padding-top: 5px
position: relative position: relative
&:hover &:hover
background: $background background: $background
@@ -95,7 +91,6 @@
border-radius: $radius 0 0 $radius border-radius: $radius 0 0 $radius
&:last-child a &:last-child a
border-radius: 0 $radius $radius 0 border-radius: 0 $radius $radius 0
// Modifiers
&.is-active &.is-active
a a
background: $primary background: $primary
@@ -104,3 +99,31 @@
z-index: 1 z-index: 1
ul ul
border-bottom: none border-bottom: none
// Sizes
&.is-small
font-size: $size-small
a
padding: 2px 8px
&.is-boxed,
&.is-toggle
a
padding-bottom: 1px
padding-top: 1px
&.is-medium
font-size: $size-medium
a
padding: 10px 16px
&.is-boxed,
&.is-toggle
a
padding-bottom: 9px
padding-top: 9px
&.is-large
font-size: $size-large
a
padding: 14px 20px
&.is-boxed,
&.is-toggle
a
padding-bottom: 13px
padding-top: 13px

View File

@@ -18,7 +18,7 @@
.button .button
+control +control
+unselectable @extend .unselectable
justify-content: center justify-content: center
padding-left: 10px padding-left: 10px
padding-right: 10px padding-right: 10px
@@ -95,8 +95,6 @@
&[disabled], &[disabled],
&.is-disabled &.is-disabled
opacity: 0.5 opacity: 0.5
&.is-flexible
height: auto
&.is-fullwidth &.is-fullwidth
display: block display: block
width: 100% width: 100%

View File

@@ -1,5 +1,5 @@
.delete .delete
+unselectable @extend .unselectable
-moz-appearance: none -moz-appearance: none
-webkit-appearance: none -webkit-appearance: none
background: rgba($black, 0.2) background: rgba($black, 0.2)
@@ -56,9 +56,9 @@
.hamburger .hamburger
cursor: pointer cursor: pointer
display: block display: block
height: 50px height: $nav-height
position: relative position: relative
width: 50px width: $nav-height
span span
background: $text background: $text
display: block display: block
@@ -92,9 +92,6 @@
margin-left: -5px margin-left: -5px
transform: rotate(-45deg) transform: rotate(-45deg)
transform-origin: left bottom transform-origin: left bottom
+tablet
height: $header-height
width: $header-height
.heading .heading
display: block display: block
@@ -180,3 +177,11 @@
.delete .delete
margin-left: 4px margin-left: 4px
margin-right: -8px margin-right: -8px
.unselectable
-webkit-touch-callout: none
-webkit-user-select: none
-moz-user-select: none
-ms-user-select: none
user-select: none

View File

@@ -3,16 +3,18 @@
background: $white background: $white
display: flex display: flex
line-height: 24px line-height: 24px
min-height: $header-height
position: relative position: relative
text-align: center text-align: center
z-index: 2 z-index: 2
.container .container
align-items: stretch align-items: stretch
display: flex display: flex
min-height: $header-height
width: 100% width: 100%
// Modifiers // Modifiers
&.has-shadow &.has-shadow
box-shadow: 0 1px 2px rgba($black, 0.1) box-shadow: 0 2px 3px rgba($black, 0.1)
// Responsiveness // Responsiveness
+mobile +mobile
.container .container
@@ -62,13 +64,6 @@ a.header-item
&.is-active &.is-active
color: $link-active color: $link-active
.header-icon
+fa(14px, 24px)
color: $text
margin: 0 5px
&:hover
color: $link-hover
.header-tab .header-tab
align-items: center align-items: center
border-bottom: 1px solid transparent border-bottom: 1px solid transparent

View File

@@ -1,3 +1,5 @@
// Components
.hero-video .hero-video
+overlay +overlay
overflow: hidden overflow: hidden
@@ -15,18 +17,12 @@
+mobile +mobile
display: none display: none
.hero-content
padding: 40px 20px
// Responsiveness
+desktop
padding: 40px 0
.hero-buttons .hero-buttons
margin-top: 20px margin-top: 20px
// Responsiveness // Responsiveness
+mobile +mobile
.button .button
display: block display: flex
&:not(:last-child) &:not(:last-child)
margin-bottom: 10px margin-bottom: 10px
+tablet +tablet
@@ -35,21 +31,37 @@
.button:not(:last-child) .button:not(:last-child)
margin-right: 20px margin-right: 20px
// Containers
.hero-head,
.hero-foot
flex-shrink: 0
.hero-body
flex: 1
padding: 40px 20px
// Responsiveness
+desktop
padding-left: 0
padding-right: 0
// Main container
.hero .hero
align-items: stretch
background: $white background: $white
.header display: flex
flex-direction: column
justify-content: space-between
.nav
background: none background: none
.container & > .container
box-shadow: 0 1px 0 rgba($border, 0.3) box-shadow: 0 1px 0 rgba($border, 0.3)
.tabs .tabs
a a
border: none border: none
ul ul
border-bottom: none border-bottom: none
// Modifiers
&.is-boxed
a
padding: 8px 15px
// Colors // Colors
@each $name, $pair in $colors @each $name, $pair in $colors
$color: nth($pair, 1) $color: nth($pair, 1)
@@ -67,11 +79,11 @@
a, a,
strong strong
color: $color-invert color: $color-invert
.header .container .nav
box-shadow: 0 1px 0 rgba($color-invert, 0.2) & > .container
.header-icon, box-shadow: 0 1px 0 rgba($color-invert, 0.2)
a.header-item, a.nav-item,
.header-item > a:not(.button) .nav-item a:not(.button)
color: rgba($color-invert, 0.5) color: rgba($color-invert, 0.5)
&:hover, &:hover,
&.is-active &.is-active
@@ -82,8 +94,9 @@
opacity: 0.5 opacity: 0.5
&:hover &:hover
opacity: 1 opacity: 1
li.is-active a li
opacity: 1 &.is-active a
opacity: 1
&.is-boxed, &.is-boxed,
&.is-toggle &.is-toggle
a a
@@ -102,7 +115,7 @@
background-image: linear-gradient(141deg, $gradient-top-left 0%, $color 71%, $gradient-bottom-right 100%) background-image: linear-gradient(141deg, $gradient-top-left 0%, $color 71%, $gradient-bottom-right 100%)
// Responsiveness // Responsiveness
+mobile +mobile
.header-toggle .nav-toggle
span span
background: $color-invert background: $color-invert
&:hover &:hover
@@ -110,46 +123,26 @@
&.is-active &.is-active
span span
background: $color-invert background: $color-invert
.header-menu .nav-menu
.header-item .nav-item
border-top-color: rgba($color-invert, 0.2) border-top-color: rgba($color-invert, 0.2)
// Sizes // Sizes
&.is-fullheight,
&.is-large
// Responsiveness
+tablet
.tabs
font-size: $size-medium
&.is-medium &.is-medium
// Responsiveness
+tablet +tablet
.hero-content .hero-body
padding: 120px 20px padding-bottom: 120px
+desktop padding-top: 120px
.hero-content &.is-large
padding: 120px 0 +tablet
.hero-body
padding-bottom: 240px
padding-top: 240px
&.is-fullheight &.is-fullheight
align-items: stretch
display: flex
flex-direction: column
justify-content: space-between
min-height: 100vh min-height: 100vh
.tabs .hero-body
a align-items: stretch
padding: 15px 20px
.hero-content
display: flex display: flex
flex: 1
flex-direction: column flex-direction: column
justify-content: center justify-content: center
&.is-large padding-bottom: 240px
.tabs padding-top: 240px
a
padding: 10px 15px
// Responsiveness
+tablet
.hero-content
padding: 240px 20px
+desktop
.hero-content
padding: 240px 0

View File

@@ -55,13 +55,6 @@
text-indent: -290486px text-indent: -290486px
width: $width width: $width
=unselectable
-webkit-touch-callout: none
-webkit-user-select: none
-moz-user-select: none
-ms-user-select: none
user-select: none
=from($device) =from($device)
@media screen and (min-width: $device) @media screen and (min-width: $device)
@content @content

View File

@@ -49,6 +49,8 @@ $column-gap: 20px !default
$header-height: 50px !default $header-height: 50px !default
$nav-height: 50px !default
// Miscellaneous // Miscellaneous
$easing: ease-out !default $easing: ease-out !default