Brian Birtles - Working on Web Animations and Firefox at Mozilla Japan https://twitter.com/brianskold
- 滑らかといえばプリン
// ---- | |
// Sass (v3.3.9) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
$foo: ".foo"; | |
#{$foo} { | |
color: red; | |
} |
<ul role="tablist"> | |
<li role="presentation"> | |
<a href="#tabpanel1" id="tab1" | |
role="tab" aria-controls="tabpanel1" aria-selected="true">タブ 1</a> | |
</li> | |
<li role="presentation"> | |
<a href="#tabpanel2" id="tab2" | |
role="tab" aria-controls="tabpanel2" aria-selected="false">タブ 2</a> | |
</li> | |
<li role="presentation"> |
/* | |
* Based on metalsmith-jade | |
* https://github.com/MaxBareiss/metalsmith-jade | |
* License MIT (c) 2014 Max Bareiss | |
* */ | |
/* | |
if you need output non-HTML file (like xml), | |
you have to add `ext` metadata key and extension-name string value (like 'xml') to that content. |
mixin meta(name, content) | |
if name.match(/content-(encoding|length|language|type|style-type|script-type)|default-style|refresh|set-cookie|pragma|cache-control|expires|allow|date|last-modified|location|www-authenticate|x-ua-compatible|x-dns-prefetch-control/i) | |
meta(http-equiv="#{name}", content="#{content}") | |
else | |
meta(name="#{name}", content="#{content}") |
@charset "UTF-8"; | |
/// `$use-before` は `$collapse-margin` が `false` の場合のみ意味を持つ。引数なし(初期値)だと micro clearfix が生成される。 | |
/// @group util | |
/// @param {Bool} $collapse-margin (false) - マージンの相殺を許可するかどうか | |
/// @param {Bool} $use-before (true) - `:before` 擬似要素を出力するかどうか | |
/// @link http://nicolasgallagher.com/micro-clearfix-hack/ A new micro clearfix hack – Nicolas Gallagher | |
/// @link http://kojika17.com/2013/06/clearfix-2013.html floatを解除する手法のclearfix と 次世代のレイアウトの話|Web Design KOJIKA17 | |
@mixin clearfix($collapse-margin: false, $use-before: true) { |
// ---- | |
// Sass (v3.4.9) | |
// Compass (v1.0.1) | |
// ---- | |
@function selector-to-string($selector: "") { | |
@if $selector == "" { | |
$selector: &; | |
} | |
$selector-length: str-length(#{$selector}); |
Brian Birtles - Working on Web Animations and Firefox at Mozilla Japan https://twitter.com/brianskold
// @link http://stackoverflow.com/a/5298684 | |
var hashString = location.hash.substr(1); // remove '#' | |
history.replaceState('', document.title, window.location.pathname); |
'use strict' | |
# http://stackoverflow.com/a/7557433 | |
# https://gist.github.com/anonymous/f09b5cd487b5ad55c46e | |
module.exports = (element, partial = false, position = 0.85)-> | |
rect = element.getBoundingClientRect() | |
windowHeight = window.innerHeight or document.documentElement.clientHeight | |
windowWidth = window.innerWidth or document.documentElement.clientWidth | |
unless partial | |
rect.top >= 0 and |
'use strict' | |
el = document.createElement 'div' | |
detectionTargets = | |
transitionend: | |
'WebkitTransition': 'webkitTransitionEnd' | |
'transition': 'transitionend' | |
animationend: | |
'WebkitAnimation': 'webkitAnimationEnd' | |
'animation': 'animationend' |