Skip to content

Instantly share code, notes, and snippets.

@vm6ej04
vm6ej04 / SVG Sprite template
Last active August 29, 2016 22:24
SVG Sprite template
<!-- FILENAME.SVG -->
<svg display="none" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="CUSTOM_ID" viewBox="0 0 WIDTH HEIGHT">
<title>TITLE</title>
<!-- IT'S EASIEST TO MAKE A COMPOUND PATH AND OPTIMIZED FOR SIMPLICITY -->
<path fill="currentColor" class="CUSTOM_CLASS" d=""/> <!-- currentColor will be determined by parent's color -->
</symbol>
<symbol id="CUSTOM_ID" viewBox="0 0 WIDTH HEIGHT">
<title>TITLE</title>
@vm6ej04
vm6ej04 / @each SASS
Created September 1, 2016 02:35
SASS @each sample
$margin-map: ( <!-- Define maps -->
'xs': 20px,
's': 30px,
'm': 60px,
'l': 80px,
'xl': 120px,
'xxl':160px
);
@vm6ej04
vm6ej04 / Force browser reload on back or forward button click. *back-forward cache
Last active March 12, 2024 09:13
Force reload when click back/ forward button on iOS/ prevent button state stuck, etc. *back-forward cache
window.onpageshow = function(event) {
if (event.persisted) {
window.location.reload()
}
};
//JQUERY
$(window).bind("pageshow", function(event) {
if (event.originalEvent.persisted) {
window.location.reload()