Skip to content

Instantly share code, notes, and snippets.

View igortatarenko's full-sized avatar

Igor igortatarenko

  • Saint-Petersburg
View GitHub Profile
// File: .storybook/config.js
import { configure, addDecorator } from '@kadira/storybook';
import Theme from './../src/ui/theme';
import React from 'react';
import { ThemeProvider } from 'styled-components'
function loadStories() {
require('../stories');
}
// =============================================================================
// Медиа запросы
// =============================================================================
// меньше указанной величины (по умолчанию ширина)
@mixin below($width, $orientation: 'width') {
@media screen and (max-#{$orientation}: $width) {
@content;
}
}
@igortatarenko
igortatarenko / disable scrolling
Last active July 6, 2017 08:08
on mobile safari with js
// Disable scrolling.
document.ontouchmove = function (e) {
e.preventDefault();
}
// Enable scrolling.
document.ontouchmove = function () {
return true;
}
Обнуление пробелов между inline-block тегами
Лучшее решение без порчи html задать обертке font-size: 0;
.outer:before {
content: "";
display: inline-block;
height: 100%;
vertical-align: middle;
}
.inner {
/* здесь не должно быть абсолютного позиционирования */
display: inline-block;
@igortatarenko
igortatarenko / img position
Last active August 7, 2017 10:09
позиционирование и растягивание изображения
img {
position: absolute;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
@igortatarenko
igortatarenko / Отключение преобразования телефонных номеров в ссылки
Last active January 21, 2021 17:10
Как отключить преобразование телефонных номеров в ссылки в мобильных браузерах
Для Safari (iPhone / IPod / IPad) и Android браузера
<meta name="format-detection" content="telephone=no">
HTML:
<div class="outer">
<div class="inner"></div>
</div>
CSS:
.outer {
position: relative;
}
.inner {