Skip to content

Instantly share code, notes, and snippets.

@kerotaa
Last active December 23, 2015 23:49
Show Gist options
  • Save kerotaa/6712946 to your computer and use it in GitHub Desktop.
Save kerotaa/6712946 to your computer and use it in GitHub Desktop.
いい感じな改行を実現するSCSS mixin。
@mixin establish-break($body: true, $pre: true, $inline: true, $table: true) {
@if $body {
body {
word-wrap: break-word;
}
}
@if $pre {
pre {
overflow: auto;
white-space: pre-wrap;
word-wrap: break-word;
word-break: break-all;
}
}
@if $inline {
code, kbd, abbr, var, samp {
&::before,
&::after {
content: "\0020";
font-size: 0;
}
}
}
@if table {
table {
word-break: break-all;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment