Skip to content

Instantly share code, notes, and snippets.

@Loiree
Created February 17, 2017 19:20
Show Gist options
  • Save Loiree/d05e15e2905326c4a84cf398a09d86e1 to your computer and use it in GitHub Desktop.
Save Loiree/d05e15e2905326c4a84cf398a09d86e1 to your computer and use it in GitHub Desktop.
Init-файл для Stylus
// MATERIAL GOOGLE COLORS
////////////////////////////////
white = #fff
black = #000
red = #f44336
pink = #e91e63
purple = #9c27b0
dpurple = #673ab7
indigo = #3f51b5
blue = #2196f3
lblue = #03a9f4
cyan = #00bcd4
teal = #009688
green = #4caf50
lgreen = #88c34a
lime = #cddc39
yellow = #ffeb3b
amber = #ffc107
orange = #ff9800
dorange = #ff5722
brown = #795548
grey = #9e9e9e
bgrey = #607d8b
// CUSTOM COLORS
////////////////////////////////
c1 = #F6CC23
// ПОДКЛЮЧЕНИЕ ШРИФТОВ
////////////////////////////////
// @font-face
// font-family Bitter
// src url(Bitter-Regular.otf)
// src url(ClearSansRegular.ttf)
// src url(ClearSansRegular.woff)
// СТИЛЬ ШРИФТОВ
////////////////////////////////
body
font-family Arial, sans-serif
font-size 14px
font-weight 400
line-height 1.5
h1, h2, h3, h4, h5, h6
font-weight 400
margin 0
h1
font-size 34px
h2
font-size 30px
h3
font-size 24px
h4
font-size 18px
h5
font-size 14px
h6
font-size 12px
a
text-decoration none
transition .15s
// СВОЙСТВА
////////////////////////////////
.center
text-align center
// Вставляем переносы строк между абзацами в тексте
.text
white-space pre-wrap
// GENERAL
////////////////////////////////
html, body
min-height 100%
min-width 100%
.wrapper
box-sizing border-box
margin 0 auto
max-width 1110px
position relative
cf()
// INPUT, TEXTAREA, SELECT
////////////////////////////////
input, button, textarea
border 1px solid #ddd
border-radius 2px
box-sizing border-box
color black
outline none
transition .15s
input, textarea, select
background transparent
display block
width 100%
input, textarea
padding 9px 5px
select
outline none
padding 8px 5px
button
background white
padding 7px 15px 6px
&:hover
background #ddd
// ДРУГОЕ
////////////////////////////////
table
width 100%
td
padding 5px
border 1px solid #ddd
svg
width 15px
height 15px
fill #666
transition .15s
@import 'modules/normalize'
@import 'modules/mixins'
@import 'modules/colors'
@import 'modules/fonts'
@import 'modules/general'
// ЗАМЕНА PX НА REM
////////////////////////////////
font-size(value) {
font-size: value; /* добавляем PX как подстраховку */
if (value is inherit) {
/* делаем если нет значения для шрифта */
} else {
font-size: remify(value);
}
}
remify(value) { /* separate mixin, so it can be used elsewhere */
u = unit(value);
if (u is 'px') {
return unit(value/16, 'rem');
} else {
return unit(value, u);
}
}
// CLEARFIX
////////////////////////////////
cf()
&:before,
&:after
content " "
display table
&:after
clear both
* {
margin: 0;
padding: 0;
}
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
margin: 0;
padding: 0;
}
audio,
canvas,
progress,
video {
display: inline-block;
vertical-align: baseline;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden],
template {
display: none;
}
a {
background-color: transparent;
}
a:active,
a:hover {
outline: 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
mark {
background: #ff0;
color: #000;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 1em 40px;
}
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
pre {
overflow: auto;
}
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
button,
input,
optgroup,
select,
textarea {
color: inherit;
font: inherit;
margin: 0;
}
button {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
html input[disabled] {
cursor: default;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
input {
line-height: normal;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
}
optgroup {
font-weight: bold;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
ul, li {
margin: 0;
padding: 0;
list-style: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment