Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Updated css to use mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
jtferns committed Feb 5, 2014
1 parent fd5f296 commit 242a1dc
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 46 deletions.
3 changes: 1 addition & 2 deletions app/assets/javascripts/views/measure_view.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ class Thorax.Views.Measure extends Thorax.View
e.preventDefault()
if @$('.measure-settings').hasClass('measure-settings-expanded-delete')
@$('.delete-icon').click()
# @$('.measure-settings').toggleClass('measure-settings-expanded-delete')
@$('.measure-settings').toggleClass('measure-settings-expanded')

showDelete: (e) ->
e.preventDefault()
$btn = $(e.currentTarget)
@$('.measure-settings-expanded').toggleClass('measure-settings-expanded-delete')
$btn.toggleClass('btn-danger btn-danger-inverse').prev().toggleClass('hide')
@$('.measure-settings-expanded').toggleClass('measure-settings-expanded-delete')
6 changes: 0 additions & 6 deletions app/assets/stylesheets/application.css.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,3 @@
@import "measure_calculation";
@import "rationale";
@import "builder";






61 changes: 23 additions & 38 deletions app/assets/stylesheets/measure.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,67 +24,52 @@
.make-sm-column(12);
.title-bar;
.short-title {
font-size: 1.8em;
.vertical-spacing;
padding-right: 15px;
line-height: 1.75;
}
.full-title {
line-height: 1.6;
padding-right: 2%;
}
.settings-btn {
position: absolute;
font-size: 1.8em;
line-height: 1.75;
.fixed-vertical-spacing;
border: 0;
top: -2px;
right: 0;
background: transparent;
}
.measure-settings {
position: absolute;
line-height: 1.75;
.fixed-vertical-spacing;
height: 100%;
top: -2px;
right: 30px;
width: 0px;
overflow: hidden;
white-space:nowrap;
-webkit-transition: width 0.3s linear;
-moz-transition: width 0.3s linear;
-ms-transition: width 0.3s linear;
-o-transition: width 0.3s linear;
transition: width 0.3s linear;
.btn-transition(width 0.3s linear);
.btn-danger {
.fa {
color: @btn-danger-color;
}
}
.btn-danger-inverse {
.fa {
color: @btn-danger-bg;
}
}
.delete-measure {
.measure-settings-padding;
}
.update-measure {
.measure-settings-padding;
.fa {
color: @brand-primary;
}
}
}
.measure-settings-expanded {
width: 16%;
}
.measure-settings-expanded-delete {
width: 27%;
}
.btn-danger {
.fa {
color: @btn-danger-color;
}
}
.btn-danger-inverse {
.fa {
color: @btn-danger-bg;
}
}
.delete-measure {
margin-top: 7px;
padding-left: 6px;
padding-right: 6px;
}
.update-measure {
margin-top: 7px;
padding-left: 6px;
padding-right: 6px;
.fa {
color: @brand-primary;
}
}
}

.measure-dsp {
Expand Down
26 changes: 26 additions & 0 deletions app/assets/stylesheets/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,29 @@
.btn-danger-inverse {
.button-variant(@btn-danger-bg; @btn-danger-color; @btn-danger-border);
}

// Sliding transitions - used in Measure View settings
.btn-transition(@transition) {

This comment has been minimized.

Copy link
@carpeliam

carpeliam Feb 6, 2014

Contributor

There's an existing Bootstrap transitition mixin. You might want to look at https://github.com/twbs/bootstrap/blob/master/less/mixins.less#L127-L149, and http://getbootstrap.com/javascript/#transitions.

-webkit-transition: @transition;
-moz-transition: @transition;
-ms-transition: @transition;
-o-transition: @transition;
transition: @transition;
}

// Vertical spacing - used in Measure View title bar
.vertical-spacing() {
font-size: 1.8em;
line-height: 1.75;
}

// Fixed vertical spacing and button padding - used in Measure View settings buttons
.fixed-vertical-spacing() {
.vertical-spacing;
position: absolute;
top: -3px;
}
.measure-settings-padding {

This comment has been minimized.

Copy link
@carpeliam

carpeliam Feb 6, 2014

Contributor

There are some existing bootstrap padding numbers which I'd like to use if at all possible. See http://getbootstrap.com/customize/#components.

padding-left: 6px;
padding-right: 6px;
}

0 comments on commit 242a1dc

Please sign in to comment.