diff --git a/components.html b/components.html index 1212e53..bdf30ad 100644 --- a/components.html +++ b/components.html @@ -77,10 +77,10 @@ base_url: "../"
- + Left - + Right

Title

@@ -89,10 +89,10 @@ base_url: "../" {% highlight html %}
- + Left - + Right

Title

@@ -105,10 +105,10 @@ base_url: "../"
- + Previous - + Next

Title

@@ -117,10 +117,10 @@ base_url: "../" {% highlight html %}
- + Previous - + Next

Title

@@ -135,10 +135,10 @@ base_url: "../"
- + Left - + Right
@@ -280,7 +280,7 @@ base_url: "../" {% endhighlight %} @@ -446,19 +446,19 @@ base_url: "../"
{% highlight html %} {% endhighlight %} @@ -550,19 +550,19 @@ base_url: "../"

Buttons come in four flavors and should be used for user actions.

{% highlight html %} -Button -Button -Button -Button -Button +Button +Button +Button +Button +Button {% endhighlight %} @@ -571,22 +571,22 @@ base_url: "../"

Buttons with badges

{% highlight html %} -Badge button 1 -Badge button 1 -Badge button 1 -Badge button 1 - -Badge button 1 -Badge button 1 -Badge button 1 -Badge button 1 +Badge button 1 +Badge button 1 +Badge button 1 +Badge button 1 + +Badge button 1 +Badge button 1 +Badge button 1 +Badge button 1 {% endhighlight %} @@ -595,27 +595,27 @@ base_url: "../"

Block buttons

{% highlight html %} -Block button -Block button -Block button -Block button - -Block button -Block button -Block button -Block button +Block button +Block button +Block button +Block button + +Block button +Block button +Block button +Block button {% endhighlight %} @@ -705,7 +705,7 @@ base_url: "../" - Choose existing + Choose existing
@@ -714,7 +714,7 @@ base_url: "../" - Choose existing + Choose existing {% endhighlight %} @@ -823,10 +823,10 @@ document
- + Left - + Right

Popover title

@@ -847,10 +847,10 @@ document {% highlight html %}
- + Left - + Right

Popover title

@@ -885,10 +885,10 @@ document

Modals

- Open modal + Open modal {% highlight html %} -Open modal +Open modal diff --git a/examples/app-default/css/app.css b/examples/app-default/css/app.css index 6b33597..78db69d 100644 --- a/examples/app-default/css/app.css +++ b/examples/app-default/css/app.css @@ -11,6 +11,6 @@ padding: 10px 0; } -.form-wrapper [class*="button"] { +.form-wrapper .btn { margin: 0 10px; } \ No newline at end of file diff --git a/index.html b/index.html index cf70e00..ba40b93 100644 --- a/index.html +++ b/index.html @@ -17,8 +17,8 @@ base_url: "./"

Build mobile apps with simple HTML, CSS, and JS components.

- View the docs - Download Ratchet + View the docs + Download Ratchet
diff --git a/lib/sass/badges.scss b/lib/sass/badges.scss index 36c6651..27363c8 100644 --- a/lib/sass/badges.scss +++ b/lib/sass/badges.scss @@ -56,7 +56,7 @@ // -------------------------------------------------- // Generic styles for all badges within default buttons -[class*="button"] [class*="badge"] { +.btn [class*="badge"] { font-size: 12px; padding-top: 2px; padding-bottom: 2px; @@ -65,26 +65,21 @@ } // Styles for filled badges within filled buttons -[class*="button"] .badge-inverted, -[class*="button"]:active .badge-inverted { +.btn .badge-inverted, +.btn:active .badge-inverted { background-color: transparent; } -.button-primary:active .badge-inverted, -.button-positive:active .badge-inverted, -.button-negative:active .badge-inverted { +.btn-primary:active .badge-inverted, +.btn-positive:active .badge-inverted, +.btn-negative:active .badge-inverted { color: #fff; } // Position badges within block level buttons // Note: These are absolutely positioned so that text of button isn't "pushed" by badge and always // stays at true center of button -.button-block [class*="badge"] { +.btn-block [class*="badge"] { position: absolute; right: 0; margin-right: 10px; } - -// Badges in table-views -// -------------------------------------------------- - - diff --git a/lib/sass/buttons.scss b/lib/sass/buttons.scss index 4175214..267d38e 100644 --- a/lib/sass/buttons.scss +++ b/lib/sass/buttons.scss @@ -2,7 +2,7 @@ // Buttons // -------------------------------------------------- -[class*="button"] { +.btn { position: relative; display: inline-block; padding: 5px 8px; @@ -36,7 +36,7 @@ // -------------------------------------------------- // Primary button (Default color is blue) -.button-primary { +.btn-primary { color: #fff; border: 1px solid $primary-color; background-color: $primary-color; @@ -49,7 +49,7 @@ } // Positive button (Default color is green) -.button-positive { +.btn-positive { color: #fff; border: 1px solid $positive-color; background-color: $positive-color; @@ -62,7 +62,7 @@ } // Negative button (Default color is red) -.button-negative { +.btn-negative { color: #fff; border: 1px solid $negative-color; background-color: $negative-color; @@ -75,28 +75,28 @@ } // Outlined buttons -.button-outlined { +.btn-outlined { background-color: transparent; - &.button-primary { + &.btn-primary { color: $primary-color; } - &.button-positive { + &.btn-positive { color: $positive-color; } - &.button-negative { + &.btn-negative { color: $negative-color; } // Active states - &.button-primary:active, - &.button-positive:active, - &.button-negative:active { + &.btn-primary:active, + &.btn-positive:active, + &.btn-negative:active { color: #fff; } } // Link button (Buttons that look like links) -.button-link { +.btn-link { padding-top: 6px; padding-bottom: 6px; color: $primary-color; @@ -111,7 +111,7 @@ } // Block level buttons (full width buttons) -.button-block { +.btn-block { display: block; padding: 15px 0; margin-bottom: 10px; @@ -131,7 +131,7 @@ input[type="button"] { .bar-nav { // Generic style for all buttons in .bar-title - [class*="button"] { + .btn { position: relative; z-index: 10; // Position the buttons on top of .title padding: 6px 12px; @@ -147,7 +147,7 @@ input[type="button"] { } // Link button (Buttons that look like links) - .button-link { + .btn-link { padding: 0; margin-top: 0; font-size: 16px; @@ -168,7 +168,7 @@ input[type="button"] { // -------------------------------------------------- // Add proper padding -[class*="bar"] .button-block { +[class*="bar"] .btn-block { padding: 7px 0; margin-top: 4px; margin-bottom: 5px; @@ -181,16 +181,16 @@ input[type="button"] { // Positioning and giving darker border to look sharp against dark popover .popover { - .button-block { + .btn-block { margin-bottom: 5px; } // Remove extra margin on bottom of last button - .button-block:last-child { + .btn-block:last-child { margin-bottom: 0; } // Line the button text up with content's text - .bar-nav .button-link { + .bar-nav .btn-link { &.pull-left { margin-left: 5px; } diff --git a/lib/sass/docs.scss b/lib/sass/docs.scss index a35ed1f..6bf548f 100644 --- a/lib/sass/docs.scss +++ b/lib/sass/docs.scss @@ -59,7 +59,7 @@ body { .docs-header-content { padding: 50px 10px; - .button { + .btn { display: block; padding: 15px 30px 16px; margin: 0 10px 10px; @@ -77,7 +77,7 @@ body { background-color: transparent; } } - .button-primary { + .btn-primary { margin-bottom: 0; color: #fff; border-color: #00d1fe; @@ -185,14 +185,6 @@ body { display: inline-block; vertical-align: top; } - [class*="button"] { - padding: 0; - border: 0; - } - // Remove after button class changes. - iframe { - background-color: transparent; - } .twitter-follow-button { margin-top: 5px; } @@ -407,13 +399,13 @@ body { // Buttons #buttonsInDevice, #buttonsBadgesInDevice { - [class*="button"] { + .btn { margin-top: 10px; margin-right: 100px; margin-left: 10px; } } -#blockButtonsInDevice .button-block { +#blockButtonsInDevice .btn-block { margin: 10px; } @@ -468,7 +460,7 @@ body { // Modals #modalsInDevice { - #iwindow > .button { + #iwindow > .btn { margin: 10px; } .card p { @@ -533,11 +525,11 @@ hr { line-height: 60px; } .docs-header-content { - .button { + .btn { display: inline-block; margin: 0; } - .button-primary { + .btn-primary { margin-left: 10px; } } diff --git a/lib/sass/table-views.scss b/lib/sass/table-views.scss index 66fc21b..d519277 100644 --- a/lib/sass/table-views.scss +++ b/lib/sass/table-views.scss @@ -19,7 +19,7 @@ border-bottom: 0; } // If it's a table view of links, make sure the child takes up full table view item tap area (want to avoid selecting child buttons though) - > a:not([class*="button"]) { + > a:not(.btn) { position: relative; display: block; padding: inherit; @@ -67,7 +67,7 @@ // ------------------------------------------------------------------------------- .chevron, - [class*="button"], + .btn, [class*="badge"], .toggle { position: absolute; @@ -89,7 +89,7 @@ } // Position buttons vertically centered on the right in table view items - [class*="button"] { + .btn { left: auto; margin-top: -12px; // Half height of button } @@ -106,12 +106,12 @@ padding-left: 59px; background-position-x: 59px; // Make room for your left aligned media/icons. - > a:not([class*="button"]) { + > a:not(.btn) { margin-left: -59px; } > .pull-left, - > a:not([class*="button"]) .pull-left { + > a:not(.btn) .pull-left { position: absolute; left: 15px; z-index: 1; diff --git a/lib/sass/theme-android.scss b/lib/sass/theme-android.scss index 4d9da26..b75dda5 100644 --- a/lib/sass/theme-android.scss +++ b/lib/sass/theme-android.scss @@ -175,7 +175,7 @@ textarea, // Buttons // -------------------------------------------------- -[class*="button"] { +.btn { border: $border-default; color: $default-color; background-color: $chrome-color; @@ -189,11 +189,11 @@ textarea, } } [class*="bar-"] { - [class*="button"] { + .btn { padding-top: 9px; padding-bottom: 9px; } - .button-link { + .btn-link { padding: 0; color: $primary-color; line-height: $bar-base-height; @@ -210,7 +210,7 @@ textarea, // -------------------------------------------------- // Primary button (Default color is blue) -.button-primary { +.btn-primary { color: #fff; border: 1px solid $primary-color; background-color: $primary-color; @@ -223,7 +223,7 @@ textarea, } // Positive button (Default color is green) -.button-positive { +.btn-positive { color: #fff; border: 1px solid $positive-color; background-color: $positive-color; @@ -236,7 +236,7 @@ textarea, } // Negative button (Default color is red) -.button-negative { +.btn-negative { color: #fff; border: 1px solid $negative-color; background-color: $negative-color; @@ -249,28 +249,28 @@ textarea, } // Outlined buttons -.button-outlined { +.btn-outlined { background-color: transparent; - &.button-primary { + &.btn-primary { color: $primary-color; } - &.button-positive { + &.btn-positive { color: $positive-color; } - &.button-negative { + &.btn-negative { color: $negative-color; } // Active states - &.button-primary:active, - &.button-positive:active, - &.button-negative:active { + &.btn-primary:active, + &.btn-positive:active, + &.btn-negative:active { color: #fff; } } // Link button (Buttons that look like links) -.button-link { +.btn-link { color: $primary-color; background-color: transparent; border: none; @@ -286,7 +286,7 @@ textarea, // -------------------------------------------------- .bar-nav { - .button-link { + .btn-link { color: $primary-color; &:active { diff --git a/lib/sass/theme-classic.scss b/lib/sass/theme-classic.scss index 6e9d6f3..92c758a 100644 --- a/lib/sass/theme-classic.scss +++ b/lib/sass/theme-classic.scss @@ -54,49 +54,49 @@ $negative-color: #e71e1e; // Buttons // -------------------------------------------------- -[class*="button"] { +.btn { color: $default-color; border-color: $default-color; &:active, &.active, - &.button-filled { + &.btn-filled { background-color: $default-color; } } // Primary button (Default color is blue) -.button-primary { +.btn-primary { color: $primary-color; border-color: $primary-color; &:active, &.active, - &.button-filled { + &.btn-filled { background-color: $primary-color; } } // Positive button (Default color is green) -.button-positive { +.btn-positive { color: $positive-color; border-color: $positive-color; &:active, &.active, - &.button-filled { + &.btn-filled { background-color: $positive-color; } } // Negative button (Default color is red) -.button-negative { +.btn-negative { color: $negative-color; border-color: $negative-color; &:active, &.active, - &.button-filled { + &.btn-filled { background-color: $negative-color; } } @@ -104,32 +104,21 @@ $negative-color: #e71e1e; .bar-title { // Generic style for all buttons in .bar-title - [class*="button"] { + .btn { color: #fff; } // Override standard button active states - .button:active, - .button.active, - .button-prev:active, - .button-prev.active, - .button-next:active, - .button-next.active, - .button-primary:active, - .button-primary.active { + .btn:active, + .btn.active, + .btn-prev:active, + .btn-prev.active, + .btn-next:active, + .btn-next.active, + .btn-primary:active, + .btn-primary.active { color: #fff; } - - - // Directional buttons in nav bars - // -------------------------------------------------- - - .button-prev:before, - .button-prev:after, - .button-next:before, - .button-next:after { - background-color: #fff; - } } diff --git a/lib/sass/theme-ios.scss b/lib/sass/theme-ios.scss index 8c9e737..722549d 100644 --- a/lib/sass/theme-ios.scss +++ b/lib/sass/theme-ios.scss @@ -188,7 +188,7 @@ textarea, // Buttons // -------------------------------------------------- -[class*="button"] { +.btn { border: 1px solid $default-color; color: $default-color; background-color: $chrome-color; @@ -209,7 +209,7 @@ textarea, // -------------------------------------------------- // Primary button (Default color is blue) -.button-primary { +.btn-primary { color: #fff; border: 1px solid $primary-color; background-color: $primary-color; @@ -222,7 +222,7 @@ textarea, } // Positive button (Default color is green) -.button-positive { +.btn-positive { color: #fff; border: 1px solid $positive-color; background-color: $positive-color; @@ -235,7 +235,7 @@ textarea, } // Negative button (Default color is red) -.button-negative { +.btn-negative { color: #fff; border: 1px solid $negative-color; background-color: $negative-color; @@ -248,28 +248,28 @@ textarea, } // Outlined buttons -.button-outlined { +.btn-outlined { background-color: transparent; - &.button-primary { + &.btn-primary { color: $primary-color; } - &.button-positive { + &.btn-positive { color: $positive-color; } - &.button-negative { + &.btn-negative { color: $negative-color; } // Active states - &.button-primary:active, - &.button-positive:active, - &.button-negative:active { + &.btn-primary:active, + &.btn-positive:active, + &.btn-negative:active { color: #fff; } } // Link button (Buttons that look like links) -.button-link { +.btn-link { color: $primary-color; background-color: transparent; border: none; @@ -285,7 +285,7 @@ textarea, // -------------------------------------------------- .bar-nav { - .button-link { + .btn-link { color: $primary-color; &:active {