CSS Gradients - Less Mixins

I was just wondering if it's possible to alter the color of the Less mixin gradient by applying something like lighten or darken to the CSS code? Here is the Less Mixin: .css-gradient(@from: #20416A, @to: #3D69A5) { background-color: @to; background-image: -webkit-gradient(linear, left top, left bottom, from(@from), to(@to)); background-image: -webkit-linear-gradient(top, @from, @to); background-image: -moz-linear-gradient(top, @from, @to); background-image: -o-linear-gradient(top, @from, @to); background-image: -ms-linear-gradient(top, @from, @to); background-image: linear-gradient(top, @from, @to); } And in Less file I would like to do something like this: #div { width:100px; height:100px; .css-gradient (darken, 10%); } Don't know if this is possible or if there is another way I should do this.
I'm not quite sure what you would like to achieve with the darken function, maybe you could provide a sample less and corresponding css code. That would make things clearer.

以上就是CSS Gradients - Less Mixins的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏