Skip to content

Instantly share code, notes, and snippets.

View zizoclimbs's full-sized avatar
🧗

Ahmed Abdelaziz zizoclimbs

🧗
  • STC
  • Egypt
View GitHub Profile
@zizoclimbs
zizoclimbs / focus-within.js
Created April 8, 2019 14:53 — forked from aFarkas/focus-within.js
simple focus-within polyfill
(function(window, document){
'use strict';
var slice = [].slice;
var removeClass = function(elem){
elem.classList.remove('focus-within');
};
var update = (function(){
var running, last;
var action = function(){
var element = document.activeElement;
@zizoclimbs
zizoclimbs / main.js
Created April 17, 2019 16:22
Firefox issue - Picture tag doesn't work if inside angular app.
// Code goes here
function createRenderElement(parentElement, name, attrs) {
var el = document.createElement(name);
// insertion in DOM before applying attributes doesn't work in Firefox
//parentElement.appendChild(el);
for (var i = 0; i < attrs.length; i += 2) {
el.setAttribute(attrs[i], attrs[i + 1]);
// directional-scss
$dir: ltr !default;
// Default $dir if not valid
@if $dir != ltr and $dir != rtl {
$dir: ltr;
}
@function if-ltr($if, $else: null) {
@if $dir != rtl {
@zizoclimbs
zizoclimbs / index.html
Created June 4, 2020 16:20
Roving Focus
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Accessibility Solutions - Focus - Roving Focus</title>
<link rel="stylesheet" href="presentation.css" />
<link rel="stylesheet" href="roving-focus.css" />
</head>