A mixin for writing @font-face rules in SASS.
Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.
@include font-face(Samplino, fonts/Samplino);| var str = "Everyone test test test test"; | |
| var maxlength = 20; | |
| function truncate(a, b){ | |
| if(a.length > b){ | |
| var newStr = a.slice(0, b) + '...'; | |
| return newStr; | |
| } else{ | |
| return a; | |
| } |
| (function () { | |
| var categoryMenu = document.querySelector('.nav-category__list-js'); | |
| var categoryMenuItem = categoryMenu.querySelectorAll('.nav-category__item'); | |
| var dropDown = Array.from(categoryMenuItem); | |
| const handlerClick = (e) => { | |
| e.preventDefault(); | |
| if (e.currentTarget.classList.contains('active')) { |
| @mixin background-image-retina($file, $type, $width: 100%, $height: 100%) { | |
| background-image: image-url($file + '.' + $type); | |
| @media (-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) { | |
| & { | |
| background-image: image-url($file + '@2x.' + $type); | |
| @include background-size($width $height); | |
| } | |
| } | |
| } |
| $font-size: 26px; | |
| $line-height: 1.4; | |
| $lines-to-show: 3; | |
| h2 { | |
| display: block; /* Fallback for non-webkit */ | |
| display: -webkit-box; | |
| max-width: 400px; | |
| height: $font-size*$line-height*$lines-to-show; /* Fallback for non-webkit */ | |
| margin: 0 auto; |
| @mixin box-shadow($top, $left, $blur, $color, $inset: false) { | |
| @if $inset { | |
| -webkit-box-shadow:inset $top $left $blur $color; | |
| -moz-box-shadow:inset $top $left $blur $color; | |
| box-shadow:inset $top $left $blur $color; | |
| } @else { | |
| -webkit-box-shadow: $top $left $blur $color; | |
| -moz-box-shadow: $top $left $blur $color; | |
| box-shadow: $top $left $blur $color; | |
| } |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/