Skip to content

Instantly share code, notes, and snippets.

View jensgro's full-sized avatar

Jens Grochtdreis jensgro

View GitHub Profile
@jensgro
jensgro / b-a.scss
Last active December 14, 2015 08:19
Sass-mixin for creating arrows with CSS. This version doesn't take oldIE into account. There is another version which asks for modern browser or oldIE.
// adds all necessary items to :before or :after (hence b-a) to create elements with CSS, such as triangles
// top, left, bottom, right shall be added directly to the rule
// $ba == before or after
@mixin b-a($ba:before, $border-width: 10px, $padding: $border-width * 1.5, $border-side: left, $top-position: 0, $position-side: $border-side, $position-side-distance: 0, $border-color: #000) {
$seladd : ":";
padding-#{$border-side}: $padding;
position: relative;
&#{$seladd+$ba} {
content: "";
@jensgro
jensgro / box-shadow.scss
Created February 28, 2013 13:28
Simple mixin to integrate a box-shadow and include a filter-expression for oldIE. If the box-shadow is inset the filter will be omitted as it doesn't provide inset-view.
@mixin box-s($x, $y, $offset, $color, $inset: false) {
$ie-color: ie-hex-str($color);
@if $inset {
-webkit-box-shadow: inset $x $y $offset $color;
box-shadow: inset $x $y $offset $color;
} @else {
-webkit-box-shadow: $x $y $offset $color;
box-shadow: $x $y $offset $color;
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$ie-color}');
@jensgro
jensgro / styles.scss
Created February 28, 2013 14:01
central stylesheet imports all needed partials and has a variabel to be a stylesheet for modern browsers
// This is the central stylesheet.
// This variable is important to distinguish between legacy browsers and the rest.
// It has importance in conjunction with the legacy-mixin.
$isoldIE: false;
@import "compass";
// import all mixins
@import "mixins/jg-mixins",
@jensgro
jensgro / oldie.scss
Created February 28, 2013 14:06
Sass-Stylesheet for oldIE
$isoldIE: true;
// import all mixins
@import "mixins/jg-mixins"
"mixins/legacy-mixins";
@import "partials/colors",
"partials/before-after",
"partials/before-after-legacy";
@jensgro
jensgro / rgba.scss
Created February 28, 2013 14:16
rgba-mixin that creates different code, depending on the envirnoment-variable "$isoldIE". If this variable is "true" only the filter for IE8 and before is printed. If the variable is "false" rgba-color is printed.
// Converts a solid color with an alpha-channel-value into rgba
// and an IE-filter as fallback for oldIE (IE up to version 8)
@mixin all-rgba($color, $alpha) {
$rgba: rgba($color, $alpha);
$ie-color: ie-hex-str($rgba);
@if $isoldIE == false {
background-color: $color; // fallback for old browser that are not oldIE - very seldom
background-color: $rgba;
} @else if $isoldIE == true {
background-color: transparent; // counteract against the defintion for older modern browsers
@jensgro
jensgro / retina-mediaquery.css
Created March 6, 2013 17:26
Look for pixeldensity via mediaqueries, a.k.a "retina display"
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
/* Retina-specific stuff here */
}
/* read more: http://www.brettjankord.com/2012/11/28/cross-browser-retinahigh-resolution-media-queries/ */
@jensgro
jensgro / dabblet.css
Created March 21, 2013 13:25
Transforms und Z-Index
/**
* Transforms und Z-Index
*/
div {
height: 100px;
width: 100px;
position: absolute;
}
#a {
top: 100px;
@jensgro
jensgro / dabblet.css
Last active December 16, 2015 14:49 — forked from anonymous/dabblet.css
Animierte Listeneinträge - könnten Headlines sein
/**
* Animierte Listeneinträge - könnten Headlines sein
*/
body {
font-family: 'open sans', helvetica, arial,
sans-serif;
}
ul {
width: 40em;
@jensgro
jensgro / _flat-ui-colorscheme.scss
Last active December 21, 2015 18:42
Color variables for flat-ui designs. Names and colors from http://flatuicolors.com/
// names and colors from http://flatuicolors.com/
$turquoise: #1ABC9C;
$green-sea: #16A085;
$emerland: #2ECC71;
$nephritis: #27AE60;
$peter-river: #3498DB;
$belize-hole: #2980B9;
$amethyst: #9B59B6;
$wisteria: #8E44AD;
@jensgro
jensgro / dabblet.css
Last active December 16, 2015 23:19 — forked from SirPepe/dabblet.css
Übung Adaptives Layout
/**
* Übung Adaptives Layout
*/
* { box-sizing: border-box; }
body { padding: 0 1%; font-family: Arial, sans-serif; line-height: 1.6; }
nav ul { list-style: none; margin: 0; padding: 0; }
nav ul a { display: block; float: left; width:12.5%; font-weight: bold; }