Last active
September 18, 2019 00:18
-
-
Save dyanagi/411ecc046809bd6ee06eb368fb84dcff to your computer and use it in GitHub Desktop.
SASS example on Bootstrap 4 with Font Awesome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "bootstrap"; | |
@import "font-awesome"; | |
// Fix the issue that this block does not show | |
// https://github.com/twbs/bootstrap/issues/23454#issuecomment-468657049 | |
.invalid-feedback { | |
display: block; | |
} | |
// Section | |
section { | |
@extend .row; | |
margin-top: 20px; | |
} | |
// Main | |
main { | |
&.main { | |
@extend .container; | |
margin-top: 1rem; | |
} | |
&.main-fluid { | |
@extend .container-fluid; | |
padding: 0 2rem; | |
} | |
} | |
// Table wrapper | |
.my-table-wrapper { | |
@extend .table-responsive; | |
table { | |
@extend .table, .table-hover; | |
} | |
} | |
// Font Awesome - List Icons | |
// https://fontawesome.com/v4.7.0/examples/ | |
section.list-icons { | |
ul { | |
@extend .fa-ul; | |
i { | |
@extend .fa-li | |
} | |
} | |
} | |
// Forms | |
.field { | |
@extend .form-group; | |
} | |
.field, .input-group { | |
input[type=text], input[type=email], input[type=password], select, textarea { | |
@extend .form-control; | |
} | |
input[type=file] { | |
@extend .form-control-file; | |
} | |
input[type=range] { | |
@extend .form-control-range; | |
} | |
} | |
.form-check { | |
input[type=checkbox], input[type=radio] { | |
@extend .form-check-input; | |
} | |
label { | |
@extend .form-check-label; | |
} | |
} | |
.actions { | |
input[type=submit] { | |
@extend .btn, .btn-primary; | |
} | |
} | |
// Localization: Use smaller font size | |
// Set a class like <body class="<%= I18n.locale %>"> | |
// Do not use 'html:lang(ja)' which may not reflect when the locale is changed | |
body.ja, body.ko { // Japan, Korea | |
h1 { | |
font-size: 1.7rem; | |
} | |
h2 { | |
font-size: 1.5rem; | |
} | |
h3 { | |
font-size: 1.3rem; | |
} | |
h4 { | |
font-size: 1.2rem; | |
} | |
h5 { | |
font-size: 1.1rem; | |
} | |
h6 { | |
font-size: 1rem; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment