Skip to content

Instantly share code, notes, and snippets.

@encrypticus
encrypticus / styles.css
Created October 27, 2018 03:52
visually hidden
.visually-hidden:not(:focus):not(:active),
input[type="checkbox"].visually-hidden,
input[type="radio"].visually-hidden {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
border: 0;
padding: 0;
outline: 1px solid red;
@encrypticus
encrypticus / mixins.scss
Created September 1, 2019 14:37
scss mixins
// Загружает шрифт
@mixin load-font($src: null, $family: san-serif, $style: normal, $weight: normal) {
@font-face {
font-family: $family;
font-style: $style;
font-weight: $weight;
@if ($src) {
src: url($src + '.woff') format('woff'),
url($src + '.ttf') format('truetype'),
@encrypticus
encrypticus / _functions.scss
Created September 1, 2019 15:24
scss functions
// Конвертирует px в rem
@function pxToRem($target, $context: 16) {
@return ($target / $context) + rem;
}
// Конвертирует px в %
@function pxToPercent($target, $context) {
@return ($target / $context) * 100%;
}
-
var description = "",
keywords = "";
doctype html
html.nojs
head
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1")
@encrypticus
encrypticus / breakpoints.scss
Created September 1, 2019 15:32
scss mixins
// Mobile breakpoints
@mixin for-small-phone-only() {
@media (max-width: 320px) {
@content;
}
}
@mixin for-middle-phone-only() {
@media (max-width: 360px) {
@content;
@encrypticus
encrypticus / burger.scss
Created September 11, 2019 09:46
burger menu on scss
.burger {
display: none;
width: 30px;
padding: 0;
line-height: 30px;
border: 0;
cursor: pointer;
background-color: transparent;
@encrypticus
encrypticus / webpack-module
Created October 25, 2019 15:16
webpack module
module.exports = () => {
return {
module: {
rules: [
{
test: //,
use: []
}
]
}
background: repeating-linear-gradient(to bottom, transparent, transparent 10px, #f0f0f0 10px, #f0f0f0 11px), repeating-linear-gradient(to right, transparent, transparent 10px, #f0f0f0 10px, #f0f0f0 11px);