Skip to content

Instantly share code, notes, and snippets.

View siggiarni's full-sized avatar

Sigurður Árni Svanbergsson siggiarni

View GitHub Profile
*,
*:before,
*:after
{
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
@siggiarni
siggiarni / LESS.sublime-settings
Last active November 9, 2018 10:15
Misc Sublime text settings
// Sublime menu > Preferences > Package Settings > LESS > Settings - User
{
"extensions":
[
"less.css"
]
}
@siggiarni
siggiarni / dropdown-font.html
Created February 5, 2014 11:53
Font substitution work in dropdowns
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<link rel="stylesheet" type="text/css" href="http://cdn.webrupee.com/font">
<style>
body,html,*{font-family: 'WebRupee';}
option,select{ font-family:inherit;}
</style>
@siggiarni
siggiarni / nth-last-child.css
Last active October 1, 2021 22:45
Style a penultimate child in CSS thanks to the power of nth-last-child:
ul li:nth-last-child(2) {
...
}
var pixelRatio = (window.devicePixelRatio >= 1.5) ? "HiDPI" : "1X";
if (window.devicePixelRatio) ga('set', 'DevicePixelRatio', pixelRatio, 2);
// if (window.devicePixelRatio) _gaq.push(['_setCustomVar', 1, 'DevicePixelRatio', pixelRatio, 2]);
@siggiarni
siggiarni / class-list.html
Created April 14, 2014 10:24
List all CSS classes in a HTML document to the console.
<script type="text/javascript">
var used = [];
var elements = null;
//get all elements
if (typeof document.getElementsByTagName != 'undefined') {
elements = document.getElementsByTagName('*');
}
if (!elements || !elements.length) {
  • -ms- Microsoft
  • mso- Microsoft Office
  • -moz- Mozilla Foundation (Gecko-based browsers)
  • -o-, -xv- Opera Software
  • -atsc- Advanced Television Standards Committee
  • -wap- The WAP Forum
  • -webkit- Safari, Chrome (and other WebKit-based browsers)
  • -khtml- Konqueror browser
  • -apple- Webkit supports properties using the -apple- prefixes as well
  • prince- YesLogic
@siggiarni
siggiarni / Password-Fields.css
Created April 14, 2014 10:28
The only font that emulate correctly the password field's big dots of other browsers is Verdana.See: http://stackoverflow.com/questions/6859727/styling-password-fields-in-css
input[type="password"]
{
font: large Verdana,sans-serif;
letter-spacing: 1px;
}
input[type=search] {
-webkit-appearance: none;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button
{
display: none;
}