LoginSignup
2
2

More than 5 years have passed since last update.

sass 縦書き用のmixin

Last updated at Posted at 2017-06-02

縦書き用のmixin

$set_prefix: -webkit-, -moz-, -ms-, -o-, '';
//writing-mode
@mixin writing-mode( $direction ) {
    @each $prefix in $set_prefix {
        @if $direction == 'initial'{//無効化したいときを追加
            #{$prefix}writing-mode:initial;
        } @else{
            @if $prefix == '-ms-'{
                #{$prefix}writing-mode: tb- + $direction;
            } @else {
                #{$prefix}writing-mode: vertical- + $direction;
            }
        }
    }
}

//使用時
@include writing-mode(rl);
@include writing-mode(initial);

※firefoxで li に style writing-mode(rl) を使用したとき、横幅が広がってしまっていた。
原因を突き止めてはいないがwidthを指定することで回避できる。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2