-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@font-face multiple src-definition throws unwanted duplicate property warning #142
Comments
Firstly I feel for you, having to support IE8, we're often in the same boat! Secondly that looks like it should fail in scss-lint too going on what they say their rule should be doing. For me if you need to support older browsers then the duplicate property rule should probably be disabled as there's no clean way we can deduce the context of these 'hacks', definitely in the future allowing you to disable the linter via source will help with this though. But maybe @bgriffith @Snugug what do you think? |
We could add an
Thoughts? |
Could that also cover the scenario when you have old-skool background fallback? For eg:
Not necessarily asking too put much effort in it. I could disable the rule of course for the time being. |
With @font-face {
font-family: 'Graublau Web';
src: url('GraublauWeb.eot?') format('eot'), url('GraublauWeb.woff') format('woff'), url('GraublauWeb.ttf') format('truetype');
} |
I'd be happy to implement the |
I was digging around grunt-contrib-cssmin the other day and found that clean-css (which it's a wrapper for) accepts a 'compatibility' option with values such as 'ie7', 'ie8' etc. This might be the way to approach it? Treat it as a compatibility option? I didn't want cssmin to remove duplicates from the final CSS as I wanted to retain my px fallbacks for rem sizes. It's not an apple for an apple, but it's fundamentally the same situation. |
Wouldn't the compatibility options just disable this rule effectively though? I don't think we really want to go down the road of browser compatibility versions as even within those peoples requirements will differ. For example the rem / px example you gave, some people will absolutely want to declare rems and pixel fallbacks whereas others will be happy to use a gulp-plugin for example in their workflow to automatically pump an IE Also on a related note, clean-css nearly caused me to throw my laptop out the window today when they for some reason started converting some |
@DanPurdy On reflection I think you're right. In principle multiple defaults works in many cases but here it's probably best to give them a more granular level of control. Haha px to pc/pt sounds insane! |
Since 1.2.0 the duplicate property rule got introduced. When using the
@font-face
declaration you it requires use of multiplesrc
declarations if you want to support version prior to IE9. Like in the following example:The output from this is:
4:5 warning Duplicate properties are not allowed within a block no-duplicate-properties
I am not sure whether to completely file this as a bug. In the future this could be fixed by disabling linter through via source (#70).
On the other hand, when validating for a
DuplicateProperty
through the Ruby SCSS Linter it validates without any warnings.The text was updated successfully, but these errors were encountered: