wip on nav tabs

This commit is contained in:
Kevin Ross 2015-12-21 13:27:44 -06:00
parent 6782be992b
commit 46c59a0587
18 changed files with 517 additions and 87 deletions

View File

@ -26,6 +26,7 @@
- title: Material Design - title: Material Design
pages: pages:
- title: Test - title: Test
- title: Navs
- title: Buttons - title: Buttons
- title: Forms - title: Forms
- title: Labels - title: Labels

View File

@ -0,0 +1,348 @@
---
layout: docs
title: Navs
group: material-design
---
Navigation available in Bootstrap share general markup and styles, from the base `.nav` class to the active and disabled states. Swap modifier classes to switch between each style.
## Contents
* Will be replaced with the ToC, excluding the "Contents" header
{:toc}
## Tabs
Takes the basic nav from above and adds the `.nav-tabs` class to generate a tabbed interface. Use them to create tabbable regions with our [tab JavaScript plugin](#javascript-behavior).
{% example html %}
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Another link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
<!-- inverse -->
<ul class="nav nav-tabs bg-inverse">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Another link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
<!-- primary -->
<ul class="nav nav-tabs bg-primary">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Another link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
{% endexample %}
## Pills
Take that same HTML, but use `.nav-pills` instead:
{% example html %}
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Another link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
{% endexample %}
## Stacked pills
Just add `.nav-stacked` to the `.nav.nav-pills`.
{% example html %}
<ul class="nav nav-pills nav-stacked">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Another link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
{% endexample %}
## Using dropdowns
Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin]({{ site.baseurl }}/components/dropdowns/#usage).
### Tabs with dropdowns
{% example html %}
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Dropdown</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Separated link</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Another link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
{% endexample %}
### Pills with dropdowns
{% example html %}
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Dropdown</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Separated link</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Another link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
{% endexample %}
## JavaScript behavior
Use the tab JavaScript plugin—include it individually or through the compiled `bootstrap.js` file—to extend our navigational tabs and pills to create tabbable panes of local content, even via dropdown menus.
<div class="bd-example bd-example-tabs" role="tabpanel">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-expanded="true">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile">Profile</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
Dropdown
</a>
<div class="dropdown-menu">
<a class="dropdown-item" id="dropdown1-tab" href="#dropdown1" role="tab" data-toggle="tab" aria-controls="dropdown1">@fat</a>
<a class="dropdown-item" id="dropdown2-tab" href="#dropdown2" role="tab" data-toggle="tab" aria-controls="dropdown2">@mdo</a>
</div>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div role="tabpanel" class="tab-pane fade in active" id="home" aria-labelledBy="home-tab">
<p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledBy="profile-tab">
<p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p>
</div>
<div class="tab-pane fade" id="dropdown1" role="tabpanel" aria-labelledBy="dropdown1-tab">
<p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p>
</div>
<div class="tab-pane fade" id="dropdown2" role="tabpanel" aria-labelledBy="dropdown2-tab">
<p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p>
</div>
</div>
</div>
### Using data attributes
You can activate a tab or pill navigation without writing any JavaScript by simply specifying `data-toggle="tab"` or `data-toggle="pill"` on an element. Use these data attributes on `.nav-tabs` or `.nav-pills`.
<div role="tabpanel">
{% highlight html %}
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#home" role="tab">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#profile" role="tab">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#messages" role="tab">Messages</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#settings" role="tab">Settings</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="home" role="tabpanel">...</div>
<div class="tab-pane" id="profile" role="tabpanel">...</div>
<div class="tab-pane" id="messages" role="tabpanel">...</div>
<div class="tab-pane" id="settings" role="tabpanel">...</div>
</div>
{% endhighlight %}
</div>
### Via JavaScript
Enable tabbable tabs via JavaScript (each tab needs to be activated individually):
{% highlight js %}
$('#myTab a').click(function (e) {
e.preventDefault()
$(this).tab('show')
})
{% endhighlight %}
You can activate individual tabs in several ways:
{% highlight js %}
$('#myTab a[href="#profile"]').tab('show') // Select tab by name
$('#myTab a:first').tab('show') // Select first tab
$('#myTab a:last').tab('show') // Select last tab
$('#myTab li:eq(2) a').tab('show') // Select third tab (0-indexed)
{% endhighlight %}
### Fade effect
To make tabs fade in, add `.fade` to each `.tab-pane`. The first tab pane must also have `.in` to make the initial content visible.
{% highlight html %}
<div class="tab-content">
<div class="tab-pane fade in active" id="home" role="tabpanel">...</div>
<div class="tab-pane fade" id="profile" role="tabpanel">...</div>
<div class="tab-pane fade" id="messages" role="tabpanel">...</div>
<div class="tab-pane fade" id="settings" role="tabpanel">...</div>
</div>
{% endhighlight %}
### Methods
#### $().tab
Activates a tab element and content container. Tab should have either a `data-target` or an `href` targeting a container node in the DOM.
{% highlight html %}
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#home" role="tab" aria-controls="home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#profile" role="tab" aria-controls="profile">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#messages" role="tab" aria-controls="messages">Messages</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#settings" role="tab" aria-controls="settings">Settings</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="home" role="tabpanel">...</div>
<div class="tab-pane" id="profile" role="tabpanel">...</div>
<div class="tab-pane" id="messages" role="tabpanel">...</div>
<div class="tab-pane" id="settings" role="tabpanel">...</div>
</div>
<script>
$(function () {
$('#myTab a:last').tab('show')
})
</script>
{% endhighlight %}
### Events
When showing a new tab, the events fire in the following order:
1. `hide.bs.tab` (on the current active tab)
2. `show.bs.tab` (on the to-be-shown tab)
3. `hidden.bs.tab` (on the previous active tab, the same one as for the `hide.bs.tab` event)
4. `shown.bs.tab` (on the newly-active just-shown tab, the same one as for the `show.bs.tab` event)
If no tab was already active, then the `hide.bs.tab` and `hidden.bs.tab` events will not be fired.
<table class="table table-bordered table-striped table-responsive">
<thead>
<tr>
<th style="width: 150px;">Event Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>show.bs.tab</td>
<td>This event fires on tab show, but before the new tab has been shown. Use <code>event.target</code> and <code>event.relatedTarget</code> to target the active tab and the previous active tab (if available) respectively.</td>
</tr>
<tr>
<td>shown.bs.tab</td>
<td>This event fires on tab show after a tab has been shown. Use <code>event.target</code> and <code>event.relatedTarget</code> to target the active tab and the previous active tab (if available) respectively.</td>
</tr>
<tr>
<td>hide.bs.tab</td>
<td>This event fires when a new tab is to be shown (and thus the previous active tab is to be hidden). Use <code>event.target</code> and <code>event.relatedTarget</code> to target the current active tab and the new soon-to-be-active tab, respectively.</td>
</tr>
<tr>
<td>hidden.bs.tab</td>
<td>This event fires after a new tab is shown (and thus the previous active tab is hidden). Use <code>event.target</code> and <code>event.relatedTarget</code> to target the previous active tab and the new active tab, respectively.</td>
</tr>
</tbody>
</table>
{% highlight js %}
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
e.target // newly activated tab
e.relatedTarget // previous active tab
})
{% endhighlight %}

View File

@ -146,8 +146,8 @@
// have to ratchet up the specificity to kill drop shadows on disabled raised buttons // have to ratchet up the specificity to kill drop shadows on disabled raised buttons
@include mdb-disabled() { @include mdb-disabled() {
color: $mdb-btn-disabled; color: $mdb-btn-disabled;
.theme-dark & { .bg-inverse & {
color: $mdb-btn-disabled-dark; color: $mdb-btn-disabled-inverse;
} }
// flat buttons shouldn't lose transparency on disabled hover/focus // flat buttons shouldn't lose transparency on disabled hover/focus

View File

@ -14,11 +14,11 @@
@import "forms"; @import "forms";
@import "input-group"; @import "input-group";
@import "lists"; @import "lists";
@import "nav";
@import "navbar"; @import "navbar";
@import "alerts"; @import "alerts";
@import "progress"; @import "progress";
@import "type"; @import "type";
@import "tabs";
@import "popover"; @import "popover";
@import "cards"; @import "cards";
@import "modal"; @import "modal";

View File

@ -1,7 +1,13 @@
form { form {
// ensure enough room at the bottom of any form to display a one-line mdb-help // ensure enough room at the bottom of any form to display a one-line mdb-help
margin-bottom: ($mdb-help-size-ratio * $font-size-base) * $line-height; margin-bottom: ($mdb-help-size-ratio * $font-size-base) * $line-height;
// reverse the above for navbars (no help expected in a navbar form)
.navbar & {
margin: 0;
} }
}
// ----- // -----
// Inputs // Inputs

View File

@ -4,3 +4,4 @@
@import "mixins/forms"; @import "mixins/forms";
@import "mixins/buttons"; @import "mixins/buttons";
@import "mixins/hover"; @import "mixins/hover";
@import "mixins/navs";

33
scss/_nav.scss Normal file
View File

@ -0,0 +1,33 @@
// https://www.google.com/design/spec/components/tabs.html#tabs-specs
.nav { // base for tabs and pills
font-size: $mdb-nav-font-size;
font-weight: $mdb-nav-font-weight;
}
.nav-link {
//line-height: $mdb-nav-link-line-height; // set baseline line-height and font sizes
text-transform: uppercase;
}
.nav-tabs,
.nav-pills {
border: 0;
.nav-link {
padding: $mdb-nav-tabs-link-padding;
border: 0;
}
}
.nav-tabs {
.nav-link {
border-bottom: $mdb-nav-tabs-border-size solid transparent;
}
}
// colors
@include mdb-tabs-color('', $mdb-nav-tabs-color, $mdb-nav-tabs-active-color, $mdb-nav-tabs-active-border-color);
@include mdb-tabs-color('.bg-primary', $mdb-nav-tabs-primary-color, $mdb-nav-tabs-primary-active-color, $mdb-nav-tabs-primary-active-border-color);
@include mdb-tabs-color('.bg-inverse', $mdb-nav-tabs-inverse-color, $mdb-nav-tabs-inverse-active-color, $mdb-nav-tabs-inverse-active-border-color);

View File

@ -69,8 +69,8 @@ label.radio-inline {
fieldset[disabled] & { fieldset[disabled] & {
@include mdb-radio-color($mdb-radio-color-disabled); @include mdb-radio-color($mdb-radio-color-disabled);
.theme-dark & { .bg-inverse & {
@include mdb-radio-color($mdb-radio-color-disabled-dark); @include mdb-radio-color($mdb-radio-color-disabled-inverse);
} }
} }
} }

View File

@ -1,27 +0,0 @@
.nav-tabs {
background: $brand-primary;
> li {
> a {
margin: 0;
color: $white;
border: 0;
&:hover {
background-color: transparent;
border: 0;
}
}
> a,
> a:hover,
> a:focus {
font-weight: 500;
color: $white !important;
background-color: transparent !important;
border: 0 !important;
}
&.disabled > a, &.disabled > a:hover {
color: rgba($white, 0.5);
}
}
}

View File

@ -1,6 +1,6 @@
// by default, assume light-theme, no need for a marker class. // by default, assume light-theme, no need for a marker class.
// this is mostly a marker class, add it to something like the body or container. Subordinates will look for this marker - see buttons // this is mostly a marker class, add it to something like the body or container. Subordinates will look for this marker - see buttons
.theme-dark { .bg-inverse {
// foo // foo
} }

View File

@ -6,8 +6,10 @@ $gray-light: rgba($black, 0.26) !default;
$gray: rgba($black, .54) !default; // spec color $gray: rgba($black, .54) !default; // spec color
$gray-dark: rgba($black, 0.87) !default; $gray-dark: rgba($black, 0.87) !default;
$mdb-font-weight-base: 400;
// wondering if any of these could still be refactored out, but are definitely in use. // wondering if any of these could still be refactored out, but are definitely in use.
$mdb-text-color-light: rgba($white, 0.84) !default; $mdb-text-color-inverse: rgba($white, 0.84) !default;
$mdb-label-color: $gray-light !default; $mdb-label-color: $gray-light !default;
$mdb-label-color-focus: $brand-primary !default; $mdb-label-color-focus: $brand-primary !default;
$mdb-label-color-inner-focus: $gray !default; // e.g. radio label or text-muted not a control-label which is primary $mdb-label-color-inner-focus: $gray !default; // e.g. radio label or text-muted not a control-label which is primary
@ -22,6 +24,7 @@ $enable-flex: true;
@import "variables/bootstrap/code"; @import "variables/bootstrap/code";
@import "variables/bootstrap/components"; @import "variables/bootstrap/components";
@import "variables/bootstrap/forms"; @import "variables/bootstrap/forms";
@import "variables/bootstrap/nav";
@import "variables/bootstrap/state"; @import "variables/bootstrap/state";
@import "variables/bootstrap/type"; @import "variables/bootstrap/type";
@ -32,7 +35,6 @@ $enable-flex: true;
//--- //---
// verified in use with refactoring to v4 // verified in use with refactoring to v4
$mdb-font-weight-base: 400;
//--- //---
//-- unverified below here //-- unverified below here
@ -57,17 +59,15 @@ $contrast-factor: 40% !default;
$mdb-mdb-label-static-size-ratio: 75 / 100 !default; $mdb-mdb-label-static-size-ratio: 75 / 100 !default;
$mdb-help-size-ratio: 75 / 100 !default; $mdb-help-size-ratio: 75 / 100 !default;
// FIXME: with #733 customization of bootstrap, consider how these could be based on the original bs customized variables
//
////## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
$mdb-form-line-height: 1 !default; // set as 1x font-size so that paddings are easier calculated to match the spec. // sizing
$mdb-form-line-height: 1 !default; // set as 1x font-size so that padding is easier calculated to match the spec.
$mdb-label-top-margin-base: 1rem !default; $mdb-label-top-margin-base: 1rem !default;
//
$mdb-form-line-height-lg: 1 !default; // set as 1x font-size so that paddings are easier calculated to match the spec. $mdb-form-line-height-lg: 1 !default; // set as 1x font-size so that padding is easier calculated to match the spec.
$mdb-label-top-margin-lg: 1rem !default; // 16px $mdb-label-top-margin-lg: 1rem !default; // 16px
//
$mdb-form-line-height-sm: 1 !default; // set as 1x font-size so that paddings are easier calculated to match the spec. $mdb-form-line-height-sm: 1 !default; // set as 1x font-size so that padding is easier calculated to match the spec.
$mdb-label-top-margin-sm: .75rem !default; // 12px $mdb-label-top-margin-sm: .75rem !default; // 12px
// Card // Card
@ -105,7 +105,7 @@ $mdb-popover-background: rgba(101, 101, 101, 0.9) !default;
$mdb-popover-color: #ececec !default; $mdb-popover-color: #ececec !default;
// Dropdown Menu // Dropdown Menu
$mdb-dropdown-font-size: 16px !default; //$mdb-dropdown-font-size: 1rem !default;
// Radio: // Radio:
$mdb-radio-border: .125rem !default; // 2px $mdb-radio-border: .125rem !default; // 2px
@ -115,38 +115,12 @@ $mdb-radio-label-padding: .3125rem !default; // 5px
$mdb-radio-color-off: $mdb-label-color-inner-focus !default; // FIXME seems inconsistent, check spec $mdb-radio-color-off: $mdb-label-color-inner-focus !default; // FIXME seems inconsistent, check spec
$mdb-radio-color-on: $brand-primary !default; $mdb-radio-color-on: $brand-primary !default;
$mdb-radio-color-disabled: $gray-light; // light theme spec: Disabled: #000000, Opacity 26% $mdb-radio-color-disabled: $gray-light; // light theme spec: Disabled: #000000, Opacity 26%
$mdb-radio-color-disabled-dark: rgba($white, 0.30); // dark theme spec: Disabled: #FFFFFF, Opacity 30% $mdb-radio-color-disabled-inverse: rgba($white, 0.30); // dark theme spec: Disabled: #FFFFFF, Opacity 30%
// Buttons:
$mdb-btn-font-size: .875rem !default; // 14px
$mdb-btn-font-size-lg: 1rem !default;
$mdb-btn-font-size-sm: .75rem !default; // 12px
$mdb-btn-margin-bottom: .3125rem !default; // 5px
// btn with no other designation
$mdb-btn-color: $gray-dark !default;
$mdb-btn-bg: $body-bg !default; // #fff
$mdb-btn-border: #ccc !default;
//$mdb-btn-colored-bg: $body-bg !default; // transparent
$mdb-btn-colored-bg-text: $gray-dark !default;
$mdb-btn-hover-bg: rgba(#999, .20) !default; // spec: flat/light bg Hover: 20% #999999 // Shadows
$mdb-btn-disabled: rgba($black, .26) !default; // spec: light theme: Disabled text: 26% $black
$mdb-btn-hover-bg-dark: rgba(#ccc, .15) !default; // spec: dark bg Hover: 15% #CCCCCC
$mdb-btn-disabled-dark: rgba($white, .30) !default; // spec: dark theme: Disabled text: 30% $white
$mdb-btn-fab-size: 56px !default;
$mdb-btn-fab-size-mini: 40px !default;
$mdb-btn-fab-font-size: 24px !default;
$mdb-btn-icon-size: 32px !default;
$mdb-btn-icon-size-mini: 24px !default;
// SHADOWS
$mdb-shadow-key-umbra-opacity: 0.2 !default; $mdb-shadow-key-umbra-opacity: 0.2 !default;
$mdb-shadow-key-penumbra-opacity: 0.14 !default; $mdb-shadow-key-penumbra-opacity: 0.14 !default;
$mdb-shadow-ambient-shadow-opacity: 0.12 !default; $mdb-shadow-ambient-shadow-opacity: 0.12 !default;

View File

@ -17,8 +17,8 @@
@include hover-focus { @include hover-focus {
background-color: $mdb-btn-hover-bg; background-color: $mdb-btn-hover-bg;
.theme-dark & { .bg-inverse & {
background-color: $mdb-btn-hover-bg-dark; background-color: $mdb-btn-hover-bg-inverse;
} }
// reverse the above for links // reverse the above for links

18
scss/mixins/_navs.scss Normal file
View File

@ -0,0 +1,18 @@
@mixin mdb-tabs-color($parent, $color, $active-color, $active-border) {
#{$parent} {
&.nav-tabs {
.nav-link {
color: $color;
&.active {
color: $active-color;
border-color: $active-border;
@include hover-focus {
border-color: $active-border;
}
}
}
}
}
}

View File

@ -100,49 +100,49 @@
$args-extra: map-merge($args, ( $args-extra: map-merge($args, (
variation-color: $color-default, variation-color: $color-default,
variation-color-text: $mdb-text-color-light variation-color-text: $mdb-text-color-inverse
)); ));
@include call-variations-content-mixin($args-extra); @include call-variations-content-mixin($args-extra);
} }
//&#{$component}-inverse#{$selector-suffix} { //&#{$component}-inverse#{$selector-suffix} {
// $args-inverse: map-merge($args, ( // $args-inverse: map-merge($args, (
// variation-color: $mdb-brand-inverse, // variation-color: $mdb-brand-inverse,
// variation-color-text: contrast-color($mdb-brand-inverse, $gray-dark, $mdb-text-color-light) // variation-color-text: contrast-color($mdb-brand-inverse, $gray-dark, $mdb-text-color-inverse)
// )); // ));
// @include call-variations-content-mixin($args-inverse); // @include call-variations-content-mixin($args-inverse);
//} //}
&#{$component}-primary#{$selector-suffix} { &#{$component}-primary#{$selector-suffix} {
$args-primary: map-merge($args, ( $args-primary: map-merge($args, (
variation-color: $brand-primary, variation-color: $brand-primary,
variation-color-text: $mdb-text-color-light variation-color-text: $mdb-text-color-inverse
)); ));
@include call-variations-content-mixin($args-primary); @include call-variations-content-mixin($args-primary);
} }
&#{$component}-success#{$selector-suffix} { &#{$component}-success#{$selector-suffix} {
$args-success: map-merge($args, ( $args-success: map-merge($args, (
variation-color: $brand-success, variation-color: $brand-success,
variation-color-text: $mdb-text-color-light variation-color-text: $mdb-text-color-inverse
)); ));
@include call-variations-content-mixin($args-success); @include call-variations-content-mixin($args-success);
} }
&#{$component}-info#{$selector-suffix} { &#{$component}-info#{$selector-suffix} {
$args-info: map-merge($args, ( $args-info: map-merge($args, (
variation-color: $brand-info, variation-color: $brand-info,
variation-color-text: $mdb-text-color-light variation-color-text: $mdb-text-color-inverse
)); ));
@include call-variations-content-mixin($args-info); @include call-variations-content-mixin($args-info);
} }
&#{$component}-warning#{$selector-suffix} { &#{$component}-warning#{$selector-suffix} {
$args-warning: map-merge($args, ( $args-warning: map-merge($args, (
variation-color: $brand-warning, variation-color: $brand-warning,
variation-color-text: $mdb-text-color-light variation-color-text: $mdb-text-color-inverse
)); ));
@include call-variations-content-mixin($args-warning); @include call-variations-content-mixin($args-warning);
} }
&#{$component}-danger#{$selector-suffix} { &#{$component}-danger#{$selector-suffix} {
$args-danger: map-merge($args, ( $args-danger: map-merge($args, (
variation-color: $brand-danger, variation-color: $brand-danger,
variation-color-text: $mdb-text-color-light variation-color-text: $mdb-text-color-inverse
)); ));
@include call-variations-content-mixin($args-danger); @include call-variations-content-mixin($args-danger);
} }

View File

@ -4,7 +4,7 @@
.snackbar { .snackbar {
height: 0; height: 0;
font-size: 14px; font-size: 14px;
color: $mdb-text-color-light; color: $mdb-text-color-inverse;
background-color: #323232; background-color: #323232;
border-radius: $border-radius; border-radius: $border-radius;
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, padding 0s linear 0.2s, height 0s linear 0.2s; transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, padding 0s linear 0.2s, height 0s linear 0.2s;

View File

@ -1,3 +1,29 @@
// Buttons:
$mdb-btn-font-size: .875rem !default; // 14px
$mdb-btn-font-size-lg: 1rem !default;
$mdb-btn-font-size-sm: .75rem !default; // 12px
$mdb-btn-margin-bottom: .3125rem !default; // 5px
// default btn with no specific type designation
$mdb-btn-color: $gray-dark !default;
$mdb-btn-bg: $body-bg !default; // #fff
$mdb-btn-border: #ccc !default;
$mdb-btn-colored-bg-text: $gray-dark !default;
$mdb-btn-hover-bg: rgba(#999, .20) !default; // spec: flat/light bg Hover: 20% #999999
$mdb-btn-disabled: rgba($black, .26) !default; // spec: light theme: Disabled text: 26% $black
$mdb-btn-hover-bg-inverse: rgba(#ccc, .15) !default; // spec: dark bg Hover: 15% #CCCCCC
$mdb-btn-disabled-inverse: rgba($white, .30) !default; // spec: dark theme: Disabled text: 30% $white
$mdb-btn-fab-size: 56px !default;
$mdb-btn-fab-size-mini: 40px !default;
$mdb-btn-fab-font-size: 24px !default;
$mdb-btn-icon-size: 32px !default;
$mdb-btn-icon-size-mini: 24px !default;
// Buttons // Buttons
// //
// For each of Bootstrap's buttons, define text, background and border color. // For each of Bootstrap's buttons, define text, background and border color.

View File

@ -0,0 +1,50 @@
// Navs https://www.google.com/design/spec/components/tabs.html#tabs-specs
$mdb-nav-font-weight: 500 !default; // $mdb-font-weight-base
$mdb-nav-font-size: .875rem !default; // 14
// tabs
$mdb-nav-tabs-link-padding: 1.4286em .8575em !default; // spec // was .5em 1em // relative em based on 14
$mdb-nav-tabs-border-size: .143rem !default; // 2px
$mdb-nav-tabs-color: $gray !default;
$mdb-nav-tabs-active-border-color: $brand-primary !default;
$mdb-nav-tabs-active-color: $gray-dark !default;
$mdb-nav-tabs-primary-color: $mdb-text-color-inverse !default;
$mdb-nav-tabs-primary-active-border-color: #fff !default;
$mdb-nav-tabs-primary-active-color: #fff !default;
$mdb-nav-tabs-inverse-color: $mdb-text-color-inverse !default;
$mdb-nav-tabs-inverse-active-border-color: #fff !default;
$mdb-nav-tabs-inverse-active-color: #fff !default;
//$nav-item-margin: .2rem !default;
//$mdb-nav-link-line-height: 1 !default; // makes it easier to line up with the spec
//$nav-link-padding: .5em 1em !default; // changing this for tabs alters generic navbars, so do it elsewhere with higher specificity
//$nav-link-hover-bg: $gray-lighter !default;
//$nav-disabled-link-color: $gray-light !default;
//$nav-disabled-link-hover-color: $gray-light !default;
//
//$nav-tabs-border-color: #ddd !default;
//
//$nav-tabs-link-border-width: $border-width !default;
//$nav-tabs-link-hover-border-color: $gray-lighter !default;
//
$nav-tabs-active-link-hover-bg: transparent !default; // $body-bg
//$nav-tabs-active-link-hover-color: $gray !default;
//$nav-tabs-active-link-hover-border-color: #ddd !default;
//
//$nav-tabs-justified-link-border-color: #ddd !default;
//$nav-tabs-justified-active-link-border-color: $body-bg !default;
//
//$nav-pills-border-radius: $border-radius !default;
//$nav-pills-active-link-hover-bg: $component-active-bg !default;
//$nav-pills-active-link-hover-color: $component-active-color !default;

View File

@ -1,15 +1,15 @@
// Form states and alerts // Form states and alerts
// //
// Define colors for form feedback states and, by default, alerts. // Define colors for form feedback states and, by default, alerts.
$state-success-text: $mdb-text-color-light !default; $state-success-text: $mdb-text-color-inverse !default;
$state-success-bg: $brand-success !default; $state-success-bg: $brand-success !default;
$state-info-text: $mdb-text-color-light !default; $state-info-text: $mdb-text-color-inverse !default;
$state-info-bg: $brand-info !default; $state-info-bg: $brand-info !default;
$state-warning-text: $mdb-text-color-light !default; $state-warning-text: $mdb-text-color-inverse !default;
$state-warning-bg: $brand-warning !default; $state-warning-bg: $brand-warning !default;
$state-danger-text: $mdb-text-color-light !default; $state-danger-text: $mdb-text-color-inverse !default;
$state-danger-bg: $brand-danger !default; $state-danger-bg: $brand-danger !default;