Skip to content

Instantly share code, notes, and snippets.

View niktariy's full-sized avatar
🎯
Focusing

Veronika niktariy

🎯
Focusing
View GitHub Profile
@niktariy
niktariy / index.html
Last active March 28, 2019 18:57
CSS Custom properties nesting
<div class="box">
Hi! I'm box
<div class="box__child">Hi! I'm box child</div>
</div>
@niktariy
niktariy / SassMeister-input.scss
Last active March 30, 2019 12:25
Mixins in Sass VS Abandoned CSS @apply rule
// ----
// libsass (v3.5.4)
// ----
// Уже есть в препроцессорах
@mixin toolbar-theme($theme-color: late) {
background-color: hsl(120, 70%, 95%);
border-radius: 4px;
border: 1px solid $theme-color;
@niktariy
niktariy / SassMeister-input.scss
Last active March 30, 2019 12:28
Sass nesting css properties
// ----
// libsass (v3.5.4)
// ----
.block {
font: {
size: 24px;
family: "Proxima Nova", sans-serif;
weight: 600;
};
.error {
border: 1px #ff0;
background-color: #fdd;
}
.fatal-error {
@extend .error; // в CSS будет взят .fatal-error и дописан через запятую к .error
border-width: 5px;
}
@niktariy
niktariy / reqiured-valid-invalid.css
Last active July 10, 2019 11:54
Reqiured / Valid / Invalid fields CSS styling
/* CSS */
.msg-validation { display: block; }
.input-field:required ~ .msg-validation::before {
content: '*Обязательное';
}
.input-field:invalid:not(:placeholder-shown) {
@niktariy
niktariy / in-out-of-range.css
Last active July 10, 2019 11:55
Input number with in- / out-of-range validation
/* CSS */
.input-field:valid {
border-color: lightgreen;
background-color: rgba(lightgreen, 0.1);
}
.input-field:valid ~ .msg-validation::before {
display: none;
}
@niktariy
niktariy / checkbox-layout.html
Last active July 10, 2019 12:02
Checkbox layout and pure CSS validation styles
<!-- HTML -->
<div class="form-group">
<label for="dis" class="input-label">Имя</label>
<input class="input-field" type="email" id="dis"
value="Veronika" disabled>
</div>
<div class="form-group">
<label for="read" class="input-label">Ваша почта</label>
<input class="input-field" type="email" id="read"
@niktariy
niktariy / mixin-example.less
Last active July 10, 2019 12:02
Mixins in different CSS-preprocessors
.round-borders(@radius) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
.button {
background-color: #adc;
.round-borders(15px);
}
@niktariy
niktariy / _media.sass
Last active July 10, 2019 12:03
media queries mixins mobilefirst
$extra_small: 599px
$small: 600px
$medium: 900px
$large: 1200px
$extra_large: 1550px
=xs-only
@media screen and (max-width: #{$extra_small})
@content
@niktariy
niktariy / example.css
Last active July 17, 2019 13:01
style guide CSS example
/* single-line comment */
.block {
--block-box-shadow: rgba(160, 20, 88, 0.2);
--block-inner-shadow: rgba(189, 20, 90, 1);
display: flex;
align-items: baseline;
justify-content: space-between;
position: relative;
top: 0;