Skip to content

Instantly share code, notes, and snippets.

View SaraSoueidan's full-sized avatar
🎯
Focusing

Sara Soueidan SaraSoueidan

🎯
Focusing
View GitHub Profile
@SaraSoueidan
SaraSoueidan / scrollbar-mixin
Created July 26, 2013 18:18
Sass mixin for styling scrollbars in webkit by Hugo Giraudel (http://codepen.io/HugoGiraudel/pen/KFDuB)
/**
* Mixin scrollbar
*/
@mixin scrollbar($size, $primary, $secondary: lighten($primary, 25%)) {
::-webkit-scrollbar {
width: $size;
height: $size;
}
::-webkit-scrollbar-thumb {
@function makelongshadow($color) {
$val: 0px 0px $color;
@for $i from 1 through 200 {
$val: #{$val}, #{$i}px #{$i}px #{$color};
}
@return $val;
}
/*usage*/
@mixin longshadow($color) {
text-shadow: makelongshadow($color);
@SaraSoueidan
SaraSoueidan / gist:6048686
Created July 21, 2013 14:14 — forked from devongovett/gist:1381839
Javascript classList shim for IE9 (it's only supported in IE10+)
/*
* Minimal classList shim for IE 9
* By Devon Govett
* MIT LICENSE
*/
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function() {
/**
* Cross Browser helper to addEventListener.
*
* @param {HTMLElement} obj The Element to attach event to.
* @param {string} evt The event that will trigger the binded function.
* @param {function(event)} fnc The function to bind to the element.
* @return {boolean} true if it was successfuly binded.
*/
var cb_addEventListener = function(obj, evt, fnc) {
// W3C model
function whichTransitionEvent(){
var t;
var el = document.createElement('fakeelement');
var transitions = {
'transition':'transitionend',
'MSTransition':'msTransitionEnd',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
}
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}
@SaraSoueidan
SaraSoueidan / dabblet.css
Created July 21, 2013 11:18 — forked from LeaVerou/dabblet.css
Loading effect on word with pseudo-element by Lea Verou.
/**
* Loading animation like the one seen on http://www.freeger.com/projects/contextad/ with CSS
* Caveat: Not DRY. The content needs to be repeated in a data- attribute (or directly in the CSS).
*/
body {
background: #ccc51c;
min-height: 100%;
}
@SaraSoueidan
SaraSoueidan / placeholder
Created June 21, 2013 02:36
Style placeholder text
::-webkit-input-placeholder { /* WebKit browsers */
color: rgba(white, .2);
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: rgba(white, .2);
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: rgba(white, .2);
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
@SaraSoueidan
SaraSoueidan / markup
Created June 8, 2013 02:53
3-lines Nav/Menu Icon
<div id="lines" class="btn"></div>
@SaraSoueidan
SaraSoueidan / accessibly-hidden
Created June 8, 2013 02:51
Accessibly Hidden: Hides the element who gets this class but still makes it accessible for screen reader
.accesiblyhidden {
position: absolute;
width: 1px; /* Setting this to 0 make it invisible for VoiceOver */
height: 1px; /* Setting this to 0 make it invisible for VoiceOver */
padding: 0;
margin: -1px;
border: 0;
clip: rect(0 0 0 0);
overflow: hidden;
}