dist/_scut.scss in scut-0.7.2 vs dist/_scut.scss in scut-0.8.0
- old
+ new
@@ -1,8 +1,8 @@
/*
* Scut, a collection of Sass utilities to ease and improve our implementations of common style-code patterns.
-* v0.7.2
+* v0.8.0
* Docs at http://davidtheclark.github.io/scut
*/
// SCUT CLEARFIX
// http://davidtheclark.github.io/scut/#clearfix
@@ -128,17 +128,25 @@
// Adjust accordingly to create a $divisor that
// serves as context for $pixels.
$multiplier: if(unit($base) == em, 16, 1);
$divisor: scut-strip-unit($base) * $multiplier;
- $em-vals: null;
+ $em-vals: ();
@each $val in $pixels {
$val-in-ems: (scut-strip-unit($val) / $divisor) * 1em;
$em-vals: append($em-vals, $val-in-ems);
}
- @return $em-vals;
+ @if length($em-vals) == 1 {
+ // return a single value instead of a list,
+ // so it can be used in calculations
+ @return nth($em-vals, 1);
+ }
+ @else {
+ @return $em-vals;
+ }
+
}
// SCUT PIXELS TO REMS
// http://davidtheclark.github.io/scut/#pixels-to-rems
@@ -146,17 +154,25 @@
@function scut-rem (
$pixels
) {
- $rem-vals: null;
+ $rem-vals: ();
@each $val in $pixels {
$val-in-rems: scut-strip-unit($val) / 16 * 1rem;
$rem-vals: append($rem-vals, $val-in-rems);
}
- @return $rem-vals;
+ @if length($rem-vals) == 1 {
+ // return a single value instead of a list,
+ // so it can be used in calculations
+ @return nth($rem-vals, 1);
+ }
+ @else {
+ @return $rem-vals;
+ }
+
}
// SCUT BORDER
// http://davidtheclark.github.io/scut/#border
@@ -396,27 +412,25 @@
}
@mixin scut-reset-pointer {
// Clickable form elements should have a pointer.
label,
- input,
- textarea,
select,
option,
button {
cursor: pointer;
}
}
@mixin scut-reset-form {
fieldset {
- border: 0;
- margin: 0;
- padding: 0;
+ border: 0;
+ margin: 0;
+ padding: 0;
}
textarea {
- resize: vertical;
+ resize: vertical;
}
}
@mixin scut-reset-button {
// Reset default button styles, which are never used.
@@ -429,32 +443,50 @@
outline: none;
padding: 0;
width: auto;
-webkit-appearance: none;
-webkit-font-smoothing: antialiased;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
}
-@mixin scut-reset-paragraphs {
+@mixin scut-reset-paragraph {
// Some paragraph margins just get in the way.
p:first-of-type {
margin-top: 0;
}
p:last-of-type {
margin-bottom: 0;
}
}
-// Call them all!
-@mixin scut-reset {
- @include scut-reset-border-box;
- @include scut-reset-antialias;
- @include scut-reset-semanticize;
- @include scut-reset-pointer;
- @include scut-reset-form;
- @include scut-reset-button;
- @include scut-reset-paragraphs;
+// Call them all, minus exclusions!
+@mixin scut-reset ($exclude: false) {
+ @if not index($exclude, border-box) {
+ @include scut-reset-border-box;
+ }
+ @if not index($exclude, antialias) {
+ @include scut-reset-antialias;
+ }
+ @if not index($exclude, semanticize) {
+ @include scut-reset-semanticize;
+ }
+ @if not index($exclude, pointer) {
+ @include scut-reset-pointer;
+ }
+ @if not index($exclude, form) {
+ @include scut-reset-form;
+ }
+ @if not index($exclude, button) {
+ @include scut-reset-button;
+ }
+ @if not index($exclude, paragraph) {
+ @include scut-reset-paragraph;
+ }
}
// SCUT SELECTED
// http://davidtheclark.github.io/scut/#selected
@@ -1588,6 +1620,21 @@
}
%scut-side-lined {
@include scut-side-lined;
+}
+
+// SCUT TRUNCATE
+// http://davidtheclark.github.io/scut/#truncate
+
+@mixin scut-truncate {
+
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+}
+
+%scut-truncate {
+ @include scut-truncate;
}
\ No newline at end of file