|
| 1 | +// ************************************* |
| 2 | +// |
| 3 | +// Highlight |
| 4 | +// -> Highly stylized link |
| 5 | +// Credit: http://www.webdesignerdepot.com/ |
| 6 | +// CodePen: http://codepen.io/drewbarontini/pen/vOYgwE |
| 7 | +// |
| 8 | +// ------------------------------------- |
| 9 | +// Template (Haml) |
| 10 | +// ------------------------------------- |
| 11 | +// |
| 12 | +// %a.highlight |
| 13 | +// |
| 14 | +// ************************************* |
| 15 | +
|
| 16 | +.highlight |
| 17 | + background-image: linear-gradient(to right, rgba(white, 0) 50%, $highlight-background 50%) |
| 18 | + background-position: 0 0 |
| 19 | + background-size: 200% auto |
| 20 | + border-bottom: $highlight-border |
| 21 | + color: $highlight-color |
| 22 | + text-decoration: $highlight-textDecoration |
| 23 | + transition: background-position $b-transition |
| 24 | + |
| 25 | + &:active, |
| 26 | + &:focus, |
| 27 | + &:hover |
| 28 | + background-position: -100% 0 |
| 29 | + color: $highlight-color |
| 30 | + |
| 31 | +// ------------------------------------- |
| 32 | +// Modifiers |
| 33 | +// ------------------------------------- |
| 34 | +
|
| 35 | +// ----- Bordered ----- // |
| 36 | +
|
| 37 | +.highlight--bordered |
| 38 | + position: relative |
| 39 | + |
| 40 | + &::after, |
| 41 | + &::before |
| 42 | + content: '' |
| 43 | + height: $highlight--bordered-borderWidth |
| 44 | + left: 0 |
| 45 | + position: absolute |
| 46 | + top: 100% |
| 47 | + width: 100% |
| 48 | + |
| 49 | + &::after |
| 50 | + background: $highlight--bordered-borderColor |
| 51 | + |
| 52 | + &::before |
| 53 | + background: $highlight--bordered-cover-background |
| 54 | + transform: translateX(0) |
| 55 | + transition: transform $b-transition |
| 56 | + z-index: 1 |
| 57 | + |
| 58 | + &:active, |
| 59 | + &:focus, |
| 60 | + &:hover |
| 61 | + background: none |
| 62 | + |
| 63 | + &::before |
| 64 | + transform: translateX(100%) |
| 65 | + |
| 66 | +// Bordered: Modifiers: Alt |
| 67 | +
|
| 68 | +.highlight--bordered--alt |
| 69 | + |
| 70 | + &::before |
| 71 | + background: $highlight--bordered--alt-cover-background |
| 72 | + |
| 73 | +// Bordered: Modifiers: Inverted |
| 74 | +
|
| 75 | +.highlight--bordered--inverted |
| 76 | + |
| 77 | + &::after |
| 78 | + background: $highlight-background |
| 79 | + |
| 80 | + &::before |
| 81 | + background: $highlight--bordered--inverted-cover-background |
| 82 | + |
| 83 | +// Bordered: States: Active |
| 84 | +
|
| 85 | +.highlight--bordered.is-active |
| 86 | + |
| 87 | + &::before |
| 88 | + display: none |
0 commit comments