niceprototypes / super-gradient Goto Github PK
View Code? Open in Web Editor NEWSCSS gradient mixin w/ fallbacks
SCSS gradient mixin w/ fallbacks
Use index
or not not index
if you absolutely want a boolean rather than using a loop for contains
function.
@function contains($haystack, $needle) {
@return not not index($haystack, $needle);
}
See http://lea.verou.me/2013/04/can-we-get-rid-of-gradient-prefixes/ as a reference.
Tl;dr: use WebKit and standard only.
You could dramatically lighten your code by using an arglist
rather than a custom-formatted list for color-stops. Then you would not need the colorString
and colorSubString
functions.
What about something like this (shorten on purpose)?
@mixin sgradient($direction, $type, $args...) {
background: #{$type}-gradient($direction, $args...);
}
.element {
@include sgradient(to bottom, linear, purple 0%, red 25%, yellow 50%, green 75%, blue 100%);
}
CSS (and Sass) is an hyphen-powered language. We don't use camelCase at all. You might want to stick to hyphen as a convention. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.