Project

General

Profile

Download (6.84 KB) Statistics
| Branch: | Tag: | Revision:
1
// styles for custom fields
2

    
3
// ===================== Mixins ==============================//
4

    
5
@mixin composite-field-wrapper() {
6
  border: valo-border($border: $v-border, $color: $v-background-color, $strength: 0.7);
7
  border-radius: $v-border-radius;
8
  background-color: $v-app-background-color;
9
  padding: round($v-unit-size / 4);
10
}
11

    
12
@mixin icon-button-field-button($button-style-name, $button-count: 1, $button-alignment: 'right', $button-width: $v-unit-size, $button-index: 0){
13

    
14
   $sibling-selector:'';
15
   @if $button-index > 0 {
16
    $sibling-selector:'+';
17
   }
18
    
19
  #{$sibling-selector} .#{$button-style-name} {
20
        z-index: 10;
21
        width: $button-width;
22
        position: absolute;
23
        @if $button-alignment == 'left' {
24
            left: $button-width * $button-index + 1px;
25
        }
26
        @if $button-alignment == 'right' {
27
            right: $button-width * ($button-count - 1 - $button-index) + 1px;
28
        }
29
        @if $button-index < $button-count - 1 {
30
            $button-index: $button-index + 1;
31
            @include icon-button-field-button($button-style-name, $button-count, $button-alignment, $button-width, $button-index);
32
        }
33
    }
34
}
35

    
36

    
37
@mixin icon-button-field($field-stylename, $button-style-name, $button-count: 1, $button-alignment: 'right', $button-width: $v-unit-size) {
38
    position: relative; // needs to be a positioned element
39
    height: $v-line-height * 2;
40
    .v-caption {
41
        display: block;
42
    }   
43
    .#{$field-stylename} {
44
        @if $button-alignment == 'left' {
45
            padding-left: $button-count * $button-width; 
46
        }
47
        @if $button-alignment == 'right' {
48
            $more-padding: 0px;
49
            @if $field-stylename == 'v-select' {
50
                $more-padding: 8px;
51
            }
52
            padding-right: $button-count * $button-width + $more-padding; 
53
        }        
54
    }
55
    // recursive include
56
    @include icon-button-field-button($button-style-name, $button-count, $button-alignment, $button-width);
57
}
58

    
59
// ===================== Styles ===================== //
60

    
61
body .edit-valo { // increasing specifity to allow overriding the valo default field themes
62
  
63
  .composite-field-wrapper {
64
        @include composite-field-wrapper;
65
    }
66
  
67
  // ------------  TimePeriodField ------------ //
68
  .v-time-period-field {
69
      .margin-wrapper {
70
          @include composite-field-wrapper;
71
      }
72
      .to-label {
73
        padding: 0 round($v-unit-size / 2);
74
      }
75
  }
76
  
77
  .v-textfield-helper-field { 
78
          @if is-dark-color($v-background-color) {
79
              $helper-color: lighten($v-background-color, 20%);
80
          } @else {
81
              $helper-color: lighten($v-background-color, -20%);
82
          }
83
          color: $helper-color;
84
          background-color: valo-font-color($helper-color);
85
          border-radius: $v-border-radius;
86
   }
87
  
88
  // ------------ v-switchable-textfield ------------ //
89
  .v-switchable-textfield {
90
    @include icon-button-field('v-textfield', 'v-switch', 1, 'right');
91
    .v-switch {
92
        top: round($v-unit-size * 0.75);
93
        right: round($v-unit-size / 4);
94
    }
95
  }
96
  
97
  // ------------ v-person-field ------------ //
98
  .v-person-field {
99
    .v-caption {
100
        display: block;
101
    }
102
    .cache-field, .details-fields  {
103
        padding-right: $v-unit-size;
104
    }
105
    .v-switch {
106
        z-index: 10;
107
        position: absolute;
108
        right: round($v-unit-size / 4) + 3px; // + boxshadow width from $v-shadow, TODO extract value from variable?
109
        bottom: 15px;
110
    } 
111
  }
112
  .v-person-field-cache-mode {
113
        .cache-field {
114
            display: block;
115
        }
116
        .details-fields {
117
            display: none;
118
        }
119
    }
120
   .v-person-field-details-mode {
121
        .cache-field {
122
            display: none;
123
        }
124
        .details-fields {
125
            display: block;
126
        }
127
    }
128
    
129
   // ------------ team-or-person-field ------------ // 
130
   .v-team-or-person-field {
131
   
132
        .toolbar {
133
            float: right;
134
            height: $v-unit-size;
135
        }
136
        .margin-wrapper {
137
            @include composite-field-wrapper;
138
            
139
        }
140
    }
141
    
142
    // ------------ v-related-entity-list-select ------------ //
143

    
144
    .v-related-entity-list-select {
145
        @include icon-button-field('v-select', 'v-button', 2, 'right', $v-unit-size);
146
    }
147
    
148
    // ------------ v-related-entity-combobox ------------ //
149
    .v-related-entity-combobox {
150
        @include icon-button-field('v-filterselect', 'v-button', 2, 'right', $v-unit-size);
151
        .v-filterselect-button {
152
            right: $v-unit-size * 2 + 1px;
153
        }
154
    }
155
    
156
    // ------------ minMaxTextField ------------ //
157
    .v-min-max-text-field {
158
        @include composite-field-wrapper;
159
    }
160
    
161
    // ------------ v-geolocation-field ------------- //
162
    .v-geolocation-field {
163
        .wrapper{
164
          @include composite-field-wrapper;
165
        }
166
    }
167
    
168
    // Switch 
169
    
170
    $widget-height: round($v-unit-size / 2);
171
    $widget-width: $v-unit-size;
172
    $widget-border-width: 1px; // must match the value as set in $v-border
173
    $widget-border-radius: round($widget-height / 2);
174
    
175
    $knob-border-width: 1px; // must match the value as set in $v-border
176
    $slider-height: $widget-height - 2 * $widget-border-width;
177
    $knob-inner-height: $slider-height - 2 * $knob-border-width;
178
    
179
    $knob-border-width: 1px; // must match the value as set in $v-border
180
    $slider-width: round($widget-width - 2 * $widget-border-width - $slider-height / 2) * 2;
181
    $knob-border-radius: round($knob-height / 2);
182
    $knob-left: round(($slider-width - $slider-height) / 2);
183
    
184
    .v-switch-dom {
185
        height: $widget-height;
186
        width: $widget-width;
187
        border: valo-border($border: $v-border, $color: $v-background-color, $strength: 0.7);
188
        border-radius: $v-border-radius;
189
        @include box-shadow(valo-bevel-and-shadow($bevel: $v-bevel, $shadow: $v-shadow, $background-color: $v-background-color, $gradient: $v-gradient));
190
        
191
        .v-switch-slider {
192
            height: $slider-height; 
193
            width: $slider-width;
194
            background: none;
195
        }
196
        
197
        .v-switch-on-plate, .v-switch-off-plate {
198
            position: absolute;
199
            top: 0px;
200
            left: 0px;
201
            height: inherit;
202
            width: round($slider-width / 2);
203
            background-color: $v-focus-color;
204
        }
205
        
206
        .v-switch-off-plate {
207
            left: round($slider-width / 2);
208
            background-color: $v-textfield-background-color;
209
        }
210
        
211
        .v-switch-knob {
212
            position: absolute;
213
            top: 0px;
214
            left: $knob-left;
215
            height: $slider-height;
216
            width: $slider-height;
217
            background-color: $v-background-color;
218
            border: valo-border($border: $v-border, $color: $v-background-color, $strength: 0.7);
219
            border-radius: $knob-border-radius;
220
        }
221
    }
222

    
223
    
224
} 
(1-1/5)