Last active
October 21, 2022 22:25
-
-
Save claviska/6117193 to your computer and use it in GitHub Desktop.
A Less mixin' for pretty buttons with Bootstrap 3
Thanks! And thanks to psybaron for converting it to SASS!
Many thanks!!
SCSS usages here (and I like the SCSS inheritance setup)
.btn { &.btn-default { @include pretty-buttons($btn-default-color, $btn-default-bg); } &.btn-primary { @include pretty-buttons($btn-primary-color, $btn-primary-bg); } &.btn-success { @include pretty-buttons($btn-success-color, $btn-success-bg); } &.btn-info { @include pretty-buttons($btn-info-color, $btn-info-bg); } &.btn-warning { @include pretty-buttons($btn-warning-color, $btn-warning-bg); } &.btn-danger { @include pretty-buttons($btn-danger-color, $btn-danger-bg); } &.btn-inverse { @include pretty-buttons(white, #474949); } }
Thanks !
In addition to psybaron and bertoost scss, to get it working out of the box you also need to import some boostrap scss definitions with something like:
@import "../../bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_variables.scss";
@import "../../bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_gradients.scss";
@import "../../bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss";
But finally it seems better to use or start with bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_theme.scss
or bower_components/bootstrap/dist/css/bootstrap-theme.css
This tool is also nice for custom buttons: http://charliepark.org/bootstrap_buttons/ .
Thank you very much it works very well for scss
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very very much!