Comments (4)
Thought I would give an example of using a mix-in as well from native sass (http://sass-lang.com)
@mixin gradient($first, $second) {
background: $second;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='$first', endColorstr='$second');
background: -webkit-gradient(linear, left top, left bottom, from($first), to($second));
background: -moz-linear-gradient(top, $first, $second);
}
.gradient {
@include gradient(black, white);
}
This will compile into:
.gradient {
background: white;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='$first', endColorstr='$second');
background: -webkit-gradient(linear, left top, left bottom, from(black), to(white));
background: -moz-linear-gradient(top, black, white);
}
from wet-boew.
Why didn't the filter $first and $second get converted? Did it get fooled by the IE-specific CSS code?
from wet-boew.
Think it is a specific problem with ie, this talks about solutions and the problem:
http://hungrysquirrel.posterous.com/sass-mixin-for-ie-linear-gradient-filter
from wet-boew.
I got it working with a solution like this (think variables for ie filter has to be in format '#{$first}':
@mixin gradient($first, $second) {
background: $second;
background: -webkit-gradient(linear, left top, left bottom, from($first), to($second));
background: -moz-linear-gradient(top, $first, $second);
}
@mixin ie-gradient($first, $second) {
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr='#{$first}', endColorstr='#{$second}');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$first}', endColorstr='#{$second}')";
}
.gradient {
@include gradient(black, white);
@include ie-gradient(black, white);
}
Rendered as:
.gradient {
background: white;
background: -webkit-gradient(linear, left top, left bottom, from(black), to(white));
background: -moz-linear-gradient(top, black, white);
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr='black', endColorstr='white');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='black', endColorstr='white')";
}
from wet-boew.
Related Issues (20)
- Share widget: HOT 6
- [BOGUE] Charts - Problème avec les apostrophes HOT 3
- [OTHER] Twitter Widget - Fails WCAG 2.1 HOT 1
- [BUG] Equalize - Update doesn't work anymore HOT 6
- [OTHER] Datatables.net child row HOT 6
- [BUG] Datatables.net - header tooltip when sorting is disabled HOT 6
- [BUG] Datatable.net - Sort issue with null
- Tables: display bug in "show entries" when set to 1 000 HOT 5
- Tabbed Interface - Carousel: Page move up and down when items are different heights
- Widget de nouvelles - probèmes avec nouveau /GCWeb/wet-boew/js/wet-boew.min.js HOT 5
- [OTHER] Release files missing from latest release (4.0.67) HOT 1
- Session Timeout: HOT 1
- Tables: Currently selected pagination not indicated to screen readers HOT 2
- Web Experience Toolkit (WET) theme: HOT 1
- Bootstrap 5 HOT 1
- Geomap: basemap down HOT 2
- How to initialize datatable with existing array? HOT 3
- Including server side errors in form validation summary HOT 2
- [OTHER] Intermittent errors when listening for 'wb-ready.wb' event HOT 5
- [BUG] Form Validation - Inline radio and checkbox inputs with wb-server-error class not recognized as errors to display
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wet-boew.