Skip to content

Instantly share code, notes, and snippets.

View BenKalsky's full-sized avatar
🎯
Focusing

Ben Kalsky BenKalsky

🎯
Focusing
View GitHub Profile
@BenKalsky
BenKalsky / triangle.css
Last active August 29, 2015 14:13
How to make 3-corner-rounded triangle in CSS (SO)
.triangle {
position: relative;
background-color: orange;
text-align: left;
}
.triangle:before,
.triangle:after {
content: '';
position: absolute;
background-color: inherit;
@BenKalsky
BenKalsky / my.css
Last active August 29, 2015 14:13 — forked from anonymous/my.css
Background Gradient Animation
background: linear-gradient(270deg, #30c59e, #d770ca);
background-size: 400% 400%;
-webkit-animation: AnimationName 11s ease infinite;
-moz-animation: AnimationName 11s ease infinite;
-o-animation: AnimationName 11s ease infinite;
animation: AnimationName 11s ease infinite;
@-webkit-keyframes AnimationName {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
@BenKalsky
BenKalsky / grab.scss
Last active August 24, 2016 22:32 — forked from shiwano/_grab.scss
Grabbing Cursor SCSS Mixin
@mixin grab-cursor {
cursor: url('http://www.google.com/intl/en_ALL/mapfiles/openhand.cur'), all-scroll;
cursor: url('data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAcABQAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8='), all-scroll;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: -o-grab;
cursor: -ms-grab;
cursor: grab;
}

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
/* Pre-Define HTML5 Elements in IE */
(function(){ var els = "source|address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|mark|meter|menu|nav|picture|progress|ruby|section|time|video".split('|'); for(var i = 0; i < els.length; i++) { document.createElement(els[i]); } } )();

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@BenKalsky
BenKalsky / dabblet.css
Created April 8, 2015 16:23
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@BenKalsky
BenKalsky / dabblet.css
Created April 8, 2015 16:29 — forked from mismith/dabblet.css
How to make 3-corner-rounded triangle in CSS (SO)
/**
* How to make 3-corner-rounded triangle in CSS (SO)
* http://stackoverflow.com/q/14446677/1397351
*/
.triangle {
position: relative;
background-color: orange;
text-align: left;
}
.triangle:before,
@BenKalsky
BenKalsky / dabblet.css
Created May 10, 2016 13:05
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;