Skip to content

Instantly share code, notes, and snippets.

View czajkovsky's full-sized avatar

Mateusz Czajka czajkovsky

  • Netguru
  • Poznań
View GitHub Profile
@czajkovsky
czajkovsky / SassMeister-input-HTML.haml
Created October 19, 2014 10:55
Generated by SassMeister.com.
%a.product-btn.product-btn--pic{ href: '#' }
Get your insurance checkup
@czajkovsky
czajkovsky / SassMeister-input-HTML.haml
Created August 7, 2014 13:50
Generated by SassMeister.com.
.avatar
%img{ src: 'http://i.imgur.com/IK8SdW2.jpg?1' }
.avatar__overlay
%a.avatar__link{ href: '#' }
window.PG =
RailsViews: {}
initCurrentView: ->
if @currentView?
@currentView.undelegateEvents()
@currentView = null
$container = $('body')
viewName = $container.data('view')
.foo {
@include relative(top 5rem left 2rem);
}
@mixin position($position, $args) {
@each $dir in top, left, bottom, right {
$i: index($args, $dir);
@if $i {
#{$dir}: nth($args, $i + 1);
}
}
position: $position;
}
@mixin position($position, $args) {
position: $position;
@each $dir in top, right, bottom, left {
#{$dir}: map-get($args, $dir);
}
}
@mixin absolute($args) {
@include position(absolute, $args);
}
@mixin position_parser($values) {
$dirs: (top, 1),
(right, 2),
(bottom, 3),
(left, 4);
@each $dir, $i in $dirs {
@if nth($values, $i) != null {
#{$dir}: nth($values, $i);
}
}
.circle {
@include circle(5rem);
background: #e14b4e;
}
.rounded {
@include rounded-box(5rem, 2rem);
background: #07a9ea;
}
.rounded--custom {
@include rounded-box(5rem, 1rem 2rem);
@mixin circle($size) {
@include size($size);
border-radius: 50%;
}
@mixin rounded-box($size, $corners) {
@include size($size);
@include inline-border-radius($corners);
}
@mixin size($args) {
@if length($args) == 2 {
width: nth($args, 1);
height: nth($args, 2);
}
@else {
width: $args;
height: $args;
}
}