Skip to content

Instantly share code, notes, and snippets.

View kovtunos's full-sized avatar

Andrey Kovtun kovtunos

View GitHub Profile
@kovtunos
kovtunos / _pug_while.pug
Last active December 6, 2018 13:53
Pug while cycle #pug
- var n = 1
while n <= 6
.item
img(src="images/screenshot-" + n++ + ".png")
@kovtunos
kovtunos / _drop_shadow_alpha.css
Last active July 28, 2016 07:39
Drop shadow on image with alpha channel #css
img {
filter: drop-shadow(0 0 20px #222);}
}
@kovtunos
kovtunos / li_arrow_bourbon.scss
Last active July 28, 2016 07:38
List (li) triangle using bourbon mixin #sass
li {
position: relative;
&::before {
@include triangle(12px, #fff, right);
content: '';
display: block;
width: 6px;
height: 10px;
position: absolute;
@kovtunos
kovtunos / _underline.scss
Last active July 28, 2016 07:36
Configurable underline border #sass
a {
color: #fff;
position: relative;
text-decoration: none;
&:hover {
&::after {
border: 1px solid #fff;
bottom: -5px;
content: '';
@kovtunos
kovtunos / _clearfix.scss
Created July 19, 2016 12:49
Clearfix #mixin
// Clearfix.
// Works in IE6 and up.
// http://zerosixthree.se/8-sass-mixins-you-must-have-in-your-toolbox/
//
// Usage: @extend %clearfix;
%clearfix {
*zoom: 1;
&:before, &:after {
content: " ";
display: table;
@kovtunos
kovtunos / _font-size.scss
Created July 19, 2016 12:36
Font size calculation #mixin
// Font size calculation.
@mixin font-size($size, $compute-line-height: false) {
font-size: #{strip-unit($size)}px;
font-size: rem($size);
@if $compute-line-height == true {
line-height: #{floor($line-height-base * $size)}px;
}
}
@kovtunos
kovtunos / _fonts.scss
Created July 19, 2016 12:33
Iconic font mapping #mixin
// Iconic font mapping.
//
// Usage:
// @include icon(a);
// @include icon(b);
@mixin icon($letter) {
.icon {
&.icon-#{$letter}::before {
content: '#{$letter}';
}
@kovtunos
kovtunos / _image_circle.scss
Created July 19, 2016 12:32
Image circle #mixin
// Image circle.
//
// Usage:
// @include image-circle(125px)
// @include image-circle(125px, 5px, #bebebe)
@mixin image-circle($width, $border-width: null, $border-color: null) {
margin: 0 auto;
width: $width;
img {
@kovtunos
kovtunos / _centered.scss
Created July 19, 2016 12:31
Center element #mixin
// Center element.
// https://css-tricks.com/snippets/sass/centering-mixin/
//
// Usage:
// Arguments: horizontal, vertical
// Note: parent div should be in relative position.
//
// @include centered();
// @include centered(true, false);
// @include centered(false, true);
@kovtunos
kovtunos / _banners.scss
Last active July 23, 2016 17:23
Full width banner #mixin
// Full width image banner.
//
// Usage:
// @include banner('../images/banner.jpg')
// @include banner('../images/banner.jpg', 700px)
// @include banner('../images/banner.jpg', 700px, center, center, #fff)
// @include banner('../images/banner.jpg', 700px, center, center, #fff, true)
// @include banner('../images/banner.jpg', 700px, center, center, #fff, false, rgba(255, 0, 0, .45))
@mixin banner($url, $height: 600px, $horizontal: center, $vertical: center, $fallback-color: null, $paralax: null, $overlay: null) {
@if($overlay) {