Skip to content

Instantly share code, notes, and snippets.

View agantelin's full-sized avatar

Leonid G. agantelin

  • Batumi, Georgia
  • 22:17 (UTC +04:00)
View GitHub Profile
@agantelin
agantelin / x-height.scss
Created September 2, 2021 06:53
CSS - Center text using x-height instead of cap-height
//----------------------------------*\
// Center text using font x-height
//----------------------------------*/
%x-height {
content: 'x';
display: inline-block;
vertical-align: middle;
width: 0;
}
@agantelin
agantelin / gist:1c7b32d47e7aabf2654c7d70afa07ad7
Last active April 21, 2022 20:12 — forked from ayamflow/gist:b602ab436ac9f05660d9c15190f4fd7b
Safari border-radius + overflow: hidden + CSS transform. FIX
// 1st way.
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
// 2nd way.
// on the element with overflow also works and it doesn't break the elements box-shadow, if any is applied
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
@agantelin
agantelin / gist:6658454c2663918a5045039895aff058
Created October 30, 2017 19:54
SASS sourcemaps & autoprefixer fix
I've been having this issue and the only way I've managed to fix it is to run both autoprefixer and cssNano together. I'd prefer to not minify when local dev because there's a legacy stylesheet with 20k lines in it... but this was the only thing that worked.
Maps work perfectly fine in Chrome, a little bit funky in FF (sometimes goes to closing bracket) and breaks in Safari (Goes to parent).
const gulp = require('gulp');
const sass = require('gulp-sass');
const sourcemaps = require('gulp-sourcemaps');
const gulpIf = require('gulp-if');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
@agantelin
agantelin / README.md
Created August 8, 2017 12:25 — forked from balupton/README.md
Responsive layouts in stylus

Responsive layouts in stylus

Why this way?

  1. There is no span1..15 styles, instead your css defines your layout and your html remains semantic and not polluted with display information. As it should be.

  2. The markup is incredibly easy, you specify the wrappers width, and then each columns width in percentages. Every other grid framework I've found is incredibly complicated with this.

  3. It allows you to have the exact same markup, and completely different styles for different devices, resolutions, stylesheets, whatever. As it should be.

@agantelin
agantelin / link_underline.styl
Created March 22, 2017 16:55
Links underlining stylus mixin (text-decoration-skip)
@agantelin
agantelin / ttf2woff2.md
Created February 17, 2016 09:59 — forked from sergejmueller/ttf2woff2.md
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@agantelin
agantelin / modal.css
Created March 11, 2015 16:23
Модальное окно (Выравнивание модального окна по центру)
.fixed-overlay__modal {
text-align: center;
white-space: nowrap;
}
.fixed-overlay__modal::after {
display: inline-block;
vertical-align: middle;
width: 0;
height: 100%;
@agantelin
agantelin / moving_from_jquery.md
Last active August 29, 2015 14:13 — forked from liamcurry/gist:2597326
Moving from jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})