Skip to content

Instantly share code, notes, and snippets.

@kerotaa
Last active December 23, 2015 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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