MaterialDesign icon indicating copy to clipboard operation
MaterialDesign copied to clipboard

Add additional CSS features?

Open JamesCoyle opened this issue 11 years ago • 7 comments

Would be nice to have some helper classes in mdi.css to easily alter icons. I was thinking basic rotation classes such as mdi-rot-90, mdi-rot-180 and mdi-rot-270 which can be used to easily reorient icons. Animated icons would also be useful such as spinning icons. I'd be happy to provide some code.

JamesCoyle avatar Sep 18 '15 08:09 JamesCoyle

It sounds like the FontAwesome CSS features. Icon stacking would be awesome too :+1:

REJack avatar Sep 18 '15 15:09 REJack

Okay, I've added the following scripts to the _extras.scss. I'll close this issue out after the next official font release which will be at v1.3.0.

$degrees: 45 90 135 180 225 270 315;
@each $degree in $degrees {
    .#{$mdi-css-prefix}-rotate-#{$degree} {
        -webkit-transform: rotate(#{$degree}deg);
        -ms-transform: rotate(#{$degree}deg);
        transform: rotate(#{$degree}deg);
    }
}
.#{$mdi-css-prefix}-flip-horizontal {
        -webkit-transform: scaleX(-1);
        transform: scaleX(-1);
        filter: FlipH;
        -ms-filter: "FlipH";
}
.#{$mdi-css-prefix}-flip-vertical {
        -webkit-transform: scaleY(-1);
        transform: scaleY(-1);
        filter: FlipV;
        -ms-filter: "FlipV";
}

@REJack Stacking might be a good idea. Not sure how useful it would be though.

Templarian avatar Sep 20 '15 20:09 Templarian

The barebones stacking that Font Awesome provides can be better coded on a per element basis through your own CSS. IMHO.

r3volution11 avatar Sep 20 '15 21:09 r3volution11

I have to agree with @r3volution11 on that. Stacking would be great if you could simply specify multiple icon classes on the element and have them all stack how you wanted, but, as it can't be implemented in such a way, it is better to implement yourself. Due to the manipulation of positioning, the CSS to enable stacking could, in the worst case, break existing styles on the element and cause unexpected effects.

JamesCoyle avatar Oct 14 '15 17:10 JamesCoyle

It might be an idea to mention these somewhere on the main page but other than that this issue can be closed assuming there were no issues with implementation.

JamesCoyle avatar Nov 19 '15 09:11 JamesCoyle

@Templarian Came across this when searching on how to accomplish a rotation. I didn't have success out of the box, not sure if it's a regression or incorrect usage:

https://jsfiddle.net/qL8rpy2d/

cklab avatar Sep 27 '16 00:09 cklab

This was added a while ago, closing this out.

PeterShaggyNoble avatar Dec 13 '17 12:12 PeterShaggyNoble