Skip to content

Commit

Permalink
SOLID-365 Create Disabled Opacity Variable (#416)
Browse files Browse the repository at this point in the history
* added variable for disabled opacity. updated variables docs

* fixed variable name to make more sense
  • Loading branch information
allisonchefec authored and samthurman committed Aug 25, 2016
1 parent fdbeab4 commit 629ad4e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _lib/solid-components/_pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
.pagination__button--disabled {
.pagination__button--prev-icon,
.pagination__button--next-icon {
opacity: .3;
opacity: $opacity-disabled;
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions _lib/solid-helpers/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ $line-height-3: 1.5; // default line-height set on the body
$line-height-form: 1.5rem;
$line-height-form-small: 1.25rem;

// Disabled opacity for buttons, forms, pagination
$opacity-disabled: .3;

// SVG
// -------------------------
// encoding this as utf8 is good!
Expand Down
2 changes: 1 addition & 1 deletion _lib/solid-utilities/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@

.button--disabled,
.button:disabled {
opacity: .3 !important;
opacity: $opacity-disabled !important;

&:hover {
cursor: default !important;
Expand Down
6 changes: 3 additions & 3 deletions _lib/solid-utilities/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
border: $border !important;

&:disabled {
opacity: .35 !important;
opacity: $opacity-disabled !important;
}
}

Expand Down Expand Up @@ -100,7 +100,7 @@ select::-ms-expand,
}

&:disabled + label {
opacity: .35 !important;
opacity: $opacity-disabled !important;
}
}

Expand All @@ -124,7 +124,7 @@ select::-ms-expand,
}

&:disabled + label {
opacity: .35 !important;
opacity: $opacity-disabled !important;
}
}

Expand Down
2 changes: 2 additions & 0 deletions docs/_includes/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ <h1 class="xs-relative xs-py3 sm-py0 sm-mb4 solid-header">
<li class="xs-py1"><a href="#colors" class="xs-block xs-px3 solid-nav__subitem">Colors</a></li>
<li class="xs-py1"><a href="#layout" class="xs-block xs-px3 solid-nav__subitem">Layout</a></li>
<li class="xs-py1"><a href="#borders" class="xs-block xs-px3 solid-nav__subitem">Borders</a></li>
<li class="xs-py1"><a href="#disabled-opacity" class="xs-block xs-px3 solid-nav__subitem">Disabled Opacity</a></li>

</ul>
{% endif %}
</li>
Expand Down
17 changes: 17 additions & 0 deletions docs/variables.html
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,20 @@ <h2 class="xs-mb1 bold">Borders</h2>
<code class="js-highlight xs-block xs-mb1"><span class="nowrap">$border-radius</span></code>

</section>


<section class="xs-mb6">

<a name="disabled-opacity"></a>
<h2 class="xs-mb1 bold">Disabled Opacity</h2>
<p class="xs-mb2">Used by disabled <a href="/buttons.html#disabled-buttons">buttons,</a> <a href="/forms.html">forms,</a> and <a href="/pagination.html">pagination</a></a>.</p>
<div class="xs-mb2">
{% highlight scss %}
.my-custom-element {
opacity: $opacity-disabled;
}
{% endhighlight %}
</div>
<code class="js-highlight xs-block"><span class="nowrap">$opacity-disabled</span></code>

</section>

0 comments on commit 629ad4e

Please sign in to comment.