Skip to content

Instantly share code, notes, and snippets.

@kareemkibue
kareemkibue / Placeholder SASS Mixin
Created July 25, 2014 22:21
HTML5 Placeholder Styling SASS Mixin
@mixin placeholder{
::-webkit-input-placeholder{ @content; }
:-moz-placeholder{ @content; }
::-moz-placeholder{ @content; }
:-ms-input-placeholder{ @content; }
}
/*use this mixin*/
@include placeholder{
@kareemkibue
kareemkibue / CSS Selection SASS Mixin
Created July 25, 2014 22:25
Selection CSS Styling SASS Mixin
@mixin selection {
::-moz-selection { @content; }
::selection { @content; }
}
/*use this mixin*/
@include selection {
/* STYLES e.g */
color: #fff; /*better to store colors as variables such as $base-color:#fff */
@kareemkibue
kareemkibue / .htaccess
Last active July 26, 2016 01:14 — forked from jxnblk/.htaccess
.htaccess required for Angular JS HTML5 Mode, Routing (Pretty URLs)
#REQUIREMENTS
# 1. <base href="/" > inside <head> before importing external (local) stylesheets and javascript files
# the above is required if deep linking
#
# 2. in the module configuration, set html5mode to TRUE i.e. $locationProvider.html5Mode(true).hashPrefix('!');
#BEGIN
Options +FollowSymLinks
@function em($target, $context: $base-font-size) {
@if $target == 0 { @return 0 }
@return $target / $context + 0em;
}
$base-font-size: 15px;
h1 {
font-size: em(21px, 15px); // Outputs 1.4em
}
@kareemkibue
kareemkibue / post.php
Last active May 10, 2016 15:06
WordPress YT Shortcode Embed (Page Load Considered)
<?php
echo do_shortcode('[youtube id="yXEfNoIZIP4"]');
?>
@kareemkibue
kareemkibue / svg-render.php
Last active May 11, 2016 15:18
Rendering SVG icons in PHP/WordPress
<?php
function render_icon($icon_id, $class=null){
?>
<svg class="ico <?php echo $class; ?>">
<use xlink:href="<?php echo get_template_directory_uri() .'/images/icons.svg#'. $icon_id; ?>">
</svg>
<?php
}
@kareemkibue
kareemkibue / _media-apple.scss
Last active May 12, 2016 14:39
Ultimate SASS Media Query Mixins
@mixin respond($media) {
// iPad (General)
@if $media == ipad {
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { @content; }
}
@else if $media == ipad-portrait {
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) { @content; }
}
@else if $media == ipad-landscape {
$twitter-blue: #55acee;
$facebook-blue: #3b5998;
$pinterest-red: #bd081c;
$linkedin-blue: #0077b5;
$google-plus-red: #dd4b39;
$youtube-red: #cd201f;
$skype-blue: #00aff0;
$trello-blue: #0079BF;
$evernote-green: #2dbe60;
@kareemkibue
kareemkibue / path.php
Created May 24, 2016 14:58
Get the Absolute Hosting URL (PHP/Apache)
<?php
echo __FILE__;
?>
@kareemkibue
kareemkibue / _unset-select.scss
Last active July 15, 2017 13:49
Unsetting broswer default <select> styling (IE 9+)
// Unset HTML Form Select //
%unset-select{
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
outline: none;
border: 0px none;
// IE 9-10
&::-ms-expand{