Skip to content

Instantly share code, notes, and snippets.

View MoOx's full-sized avatar
:shipit:
Freelance React / React Native Expert, Cross-platform fanboy (native, web...)

Max MoOx

:shipit:
Freelance React / React Native Expert, Cross-platform fanboy (native, web...)
View GitHub Profile
/* Templates Rules (using Sass placeholders) */
%template-name
%template-name--modifier-name
%template-name__sub-object
%template-name__sub-object--modifier-name
/* Component Rules */
.component-name
.component-name--modifier-name
.component-name__sub-object
<!doctype html>
<!-- require livereload -->
<link rel="stylesheet" href="index.css"></script>
<!-- require templates/* -->
<script src="index.js"></script>
@MoOx
MoOx / _flex-media.scss
Created February 21, 2013 07:34
Flex media with Sass
$flex-media-selector: false !default; // false: @extend will be used (or include if extend is not appropriate);
$flex-media-default-ratio: 1 !default;
$flex-media-ratios: "16-9" 16/9, "4-3" 4/3, "1-1" 1 !default;
$flex-media-selector-prefix: ".flex-media--" !default;
$flex-media-class: ".flex-media__item" !default;
$flex-media-overflow: hidden !default;
$flex-media-unknown-suffix: "unknown" !default;
// requirements
@mixin flex-media-requirements(
@MoOx
MoOx / index.html
Last active December 13, 2015 16:58
My nano modernizr
<html class="no-js no-touch">
<script>(function(docEl) {
docEl.className = docEl.className.replace(/\bno-js\b/, 'js');
if ('ontouchstart' in docEl) { docEl.className = docEl.className.replace(/\bno-touch\b/, 'touch'); }
})(document.documentElement);</script>
<!-- <link stylsheet />
<body>
<script> -->
</html>
@MoOx
MoOx / SassMeister-input.scss
Created February 12, 2013 06:31
Generated by SassMeister.com, the Sass playground.
// ---
// Sass (v3.2.9)
// ---
$color-one: red;
$color-two: blue;
@mixin color($prefix, $colors) {
@each $color in $colors {
@MoOx
MoOx / toggle.js
Last active December 12, 2015 09:39
Please show me how will you write that without jQuery please :) (It's not I'm not able to do it, but you already know that right ?)
// togglable ability (used for navbar)
$('.js-togglable').each(function() {
var togglableContainer = this;
$('.js-togglable__toggler', togglableContainer).on('click keyup', function() {
$('.js-togglable__item', togglableContainer).toggleClass('js-togglable__item--hide');
});
});
@MoOx
MoOx / main.js
Last active December 12, 2015 05:19
Zurb Foundation with RequireJS
requirejs.config({
name: "main",
shim: {
"foundation/jquery.cookie": { deps: ["jquery"] },
"foundation/jquery.event.move": { deps: ["jquery"] },
"foundation/jquery.event.swipe": { deps: ["jquery"] },
"foundation/jquery.foundation.accordion": { deps: ["jquery", "Modernizr"] },
"foundation/jquery.foundation.alerts": { deps: ["jquery"] },
"foundation/jquery.foundation.buttons": { deps: ["jquery"] },
/*
* grunt-fontcustom
* https://github.com/MoOx/grunt-fontcustom
*
* Copyright (c) 2013 Maxime Thirouin, contributors
* Licensed under the MIT license.
*/
'use strict';
@MoOx
MoOx / background.scss
Created December 12, 2012 08:54
Is there a sort of ternary operator in #Sass ?
//...
$background: null; // if you don't do this, background is undefined out of the @if/else scope
@if ($direction) {
$background: linear-gradient($direction, $color, $color2);
}
@else {
$background: linear-gradient($color, $color2);
}
//...
@import "shared";
// Cross-browser support for @font-face. Supports IE, Gecko, Webkit, Opera.
//
// $name : (string or list, required) The name and optional SVG-ID to use.
// - string "simpleName" => name: simpleName, ID: #simpleName
// - list "name #id" => name: name, ID: #id
// $location : (string) The location of the font files - try to find in fonts_dir if none provided.
// - Locations include the file name, without extensions:
// 'simple' => 'simple.eot', 'simple.ttf', 'simple.woff'