Skip to content

Commit f7bf64b

Browse files
author
AMJones
committed
Initial commit.
1 parent 068a7b2 commit f7bf64b

7 files changed

Lines changed: 385 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
composer.phar
22
/vendor/
3-
4-
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
5-
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
6-
# composer.lock
3+
!/composer.lock

composer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "strapless/buttons",
3+
"description": "Drop in replacement for Bootstrap buttons, with Material Design effects. Designed for the StrapLess Framework, but usable as a standalone component.",
4+
"keywords": [
5+
"buttons",
6+
"sass",
7+
"scss",
8+
"strapless",
9+
"bootstrap",
10+
"material",
11+
"ripple",
12+
"css"
13+
],
14+
"homepage": "https://www.github.com/strapless/buttons",
15+
"version": "1.0",
16+
"authors": [
17+
{
18+
"name": "Aaron M Jones",
19+
"homepage": "http://www.jonesiscoding.com"
20+
}
21+
],
22+
"license": "MIT",
23+
"require": {
24+
"strapless/base": "^1.1",
25+
"strapless/colors": "^1.0"
26+
}
27+
}

composer.lock

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scss/_bs4-shim.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
$font-size-base: 1rem !default;
3+
$font-size-lg: ($font-size-base * 1.25) !default;
4+
$font-size-sm: ($font-size-base * .875) !default;
5+
$font-weight-bold: 700 !default;
6+
7+
$line-height-base: 1.5 !default;
8+
$line-height-sm: 1.5 !default;
9+
$line-height-lg: 1.5 !default;
10+
11+
12+
$border-radius-sm: 2px !default;

scss/_buttons-mixins.scss

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
@import "buttons-variables";
2+
3+
// Outline Button Mixin
4+
@mixin btn-outline-variant($color, $active-color: darken($color, 7.5%)) {
5+
&.btn-outline {
6+
color: $color !important;
7+
.active &, &:active, &.active, &:hover, &:focus {
8+
border-color: $active-color !important;
9+
color: $active-color !important;
10+
background-color: rgba(0, 0, 0, .05) !important;
11+
}
12+
}
13+
}
14+
15+
// Material Design Flat Button Mixin
16+
@mixin btn-flat-variant($color, $active-color: darken($color, 7.5%)) {
17+
&.btn-flat {
18+
color: $color !important;
19+
.active &, &:active, &.active, &:hover, &:focus {
20+
@if $btn-border-width > 0 {
21+
border-color: transparent !important;
22+
}
23+
color: $active-color !important;
24+
background-color: rgba(0, 0, 0, .03) !important;
25+
}
26+
}
27+
}
28+
29+
// Master Button Variant Mixin (Calls Flat & Outline Button Mixins)
30+
@mixin btn-variant($background, $border, $active-background: darken($background, 7.5%), $active-border: darken($border, 10%)) {
31+
@if $background != transparent {
32+
background-color: $background;
33+
}
34+
@if $btn-border-width > 0 {
35+
border-color: $border;
36+
}
37+
@if isLight($background) {
38+
color: color("black");
39+
} @else {
40+
// Only using here due to dark bg/light font.
41+
//-webkit-font-smoothing: antialiased;
42+
color: color("white");
43+
}
44+
// Disabled comes first so active can properly restyle
45+
.disabled &, &:disabled {
46+
opacity: .5;
47+
}
48+
.active &, &:active, &.active, &:hover, &:focus {
49+
background-color: $active-background;
50+
border-color: $active-border;
51+
text-decoration: none;
52+
@if isLight($background) {
53+
color: $black;
54+
} @else {
55+
color: $white;
56+
}
57+
}
58+
@include btn-outline-variant($background, $active-background);
59+
@include btn-flat-variant($background, $active-background);
60+
}
61+
62+
// Button sizes
63+
@mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
64+
padding: $padding-vertical $padding-horizontal;
65+
font-size: $font-size;
66+
line-height: $line-height;
67+
border-radius: $border-radius;
68+
}
69+
70+
@mixin btn-variants() {
71+
@each $color, $value in $theme-colors {
72+
.btn-#{$color} {
73+
@include btn-variant($value, $value);
74+
}
75+
}
76+
}

scss/_buttons-variables.scss

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@import "strapless/colors/scss/colors";
2+
@import "strapless/base/scss/base";
3+
@import "bs4-shim";
4+
5+
$btn-padding-x: (space-x(md) * 1rem) !default;
6+
$btn-padding-y: (space-y(md) * 1rem) !default;
7+
$btn-line-height: $line-height-base !default;
8+
$btn-height: ($font-size-base * $btn-line-height) + ($btn-padding-y * 2) !default;
9+
10+
$btn-xs-padding-x: (space-x(xs) * 1rem) !default;
11+
$btn-xs-padding-y: (space-y(xs) * 1rem) !default;
12+
$btn-xs-height: (($btn-xs-padding-y * 2) + $line-height-sm) !default;
13+
14+
$btn-sm-padding-x: (space-x(sm) * 1rem) !default;
15+
$btn-sm-padding-y: (space-y(sm) * 1rem) !default;
16+
$btn-sm-height: (($btn-sm-padding-y * 2) + $line-height-sm) !default;
17+
18+
$btn-lg-padding-x: (space-x(lg) * 1rem) !default;
19+
$btn-lg-padding-y: (space-y(lg) * 1rem) !default;
20+
$btn-lg-height: (($btn-lg-padding-y * 2) + $line-height-lg) !default;
21+
22+
$btn-border-width: 0 !default;
23+
$btn-font-weight: if(variable-exists(font-weight-medium), $font-weight-medium, $font-weight-bold) !default;
24+
25+
$btn-default-color: gray(600);
26+
$btn-default-bg: color(white);
27+
$btn-border-radius: $border-radius-sm;
28+
29+
$btn-transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !default;
30+
$btn-raised-transition: box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
31+
32+
$btn-cursor: pointer !default;

0 commit comments

Comments
 (0)