Skip to content

Commit

Permalink
Merge pull request #342 from texastribune/util-classes
Browse files Browse the repository at this point in the history
Add directory utility classes
  • Loading branch information
ashley-hebler committed Feb 2, 2021
2 parents 05b36c2 + 771ec1b commit 1ef7595
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
6 changes: 5 additions & 1 deletion assets/scss/6-components/text-input/_text-input.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Text input (c-text-input)
//
// Text form inputs. Can be used with type="text", type="email", etc. Add .is-valid if the value is not valid.
// Text form inputs. Can be used with `type="text"`, `type="email"`, etc. Add `.is-valid` if the value is not valid. Use `c-text-input__input--standard` to fix [iOS focus bug](https://stackoverflow.com/questions/2989263/disable-auto-zoom-in-input-text-tag-safari-on-iphone).
//
// Markup: 6-components/text-input/text-input.html
//
Expand All @@ -16,6 +16,10 @@
padding: $size-xxs;
transition: box-shadow .15s ease-in-out;

&--standard {
font-size: 16px;
}

// kill X button that appears on IE and edge
// because it doesn't handle JS input event correctly
&::-ms-clear {
Expand Down
18 changes: 17 additions & 1 deletion assets/scss/7-layout/_position.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// Position (l-pos-<setting>)
//
// Helper for quickly setting `position: absolute` or `position: relative`. {{isHelper}}
// Helpers for quickly setting `position`, `z-index`, and `top`. {{isHelper}}
//
// .l-pos-rel - Relative position
// .l-pos-abs - Set _`.l-pos-rel`_ on the parent to place within a defined space.
// .l-pos-sticky - Tells an element to be fixed once a user scrolls past it
// .l-pos-top - `top: 0`; We use this in directory, but should find more places where we can use this instead of setting it.
// .l-pos-front - `z-index: 1`; We use this in directory, but should find more places where we can use this instead of setting it.
//
// Markup: 7-layout/position.html
//
Expand All @@ -15,4 +18,17 @@

.l-pos-abs {
position: absolute;
}

.l-pos-sticky {
position: sticky;
z-index: 2;
}

.l-pos-top {
top: 0;
}

.l-pos-front {
z-index: 1;
}
11 changes: 11 additions & 0 deletions assets/scss/7-layout/position.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,15 @@
<div class="l-pos-rel" style="border: 1px solid #000; width: 300px; height: 100px;">
<span class="{{ className }}" style="background-color: #222; color: #fff; padding: 10px; bottom: 0; right: 0; width: 60%;">position: absolute; bottom: 0; right: 0;</span>
</div>
{% endif %}
{% if className == 'l-pos-sticky' %}
Demo TK
{% endif %}
{% if className == 'l-pos-top' %}
<div class="l-pos-rel" style="border: 1px solid #000; width: 300px; height: 100px;">
<span class="{{ className }} l-pos-abs" style="background-color: #222; color: #fff; padding: 10px;">position: absolute; top: 0</span>
</div>
{% endif %}
{% if className == 'l-pos-front' %}
Demo TK
{% endif %}
1 change: 1 addition & 0 deletions assets/scss/utilities/_all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@import 'color-helpers';
@import 'hidden';
@import 'notch';
@import 'overflow';
@import 'rounded';
@import 'shadows';
@import 'spacing';
Expand Down
13 changes: 13 additions & 0 deletions assets/scss/utilities/_overflow.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Overflow (has-overflow-x)
//
// Used for elements that can scroll left and right usually on mobile. Eventually we could add a variation for the white blurred edge.
//
//
// Markup: <div class="{{ className }} has-bg-gray-light has-padding" style="width:600px;height:150px">Scroll right on mobile</div>
//
//
// Styleguide 8.0.3
//
.has-overflow-x {
overflow-x: auto;
}

0 comments on commit 1ef7595

Please sign in to comment.