Project

General

Profile

Download (5.61 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

    
60
// ===================== Styles ===================== //
61

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

    
157
    .v-related-entity-list-select {
158
        @include icon-button-field('v-select', 'v-button', 2, 'right', $v-unit-size);
159
    }
160
    
161
    // ------------ v-related-entity-combobox ------------ //
162
    .v-related-entity-combobox {
163
        @include icon-button-field('v-filterselect', 'v-button', 2, 'right', $v-unit-size);
164
        .v-filterselect-button {
165
            right: $v-unit-size * 2 + 1px;
166
        }
167
    }
168
    
169
    // ------------ minMaxTextField ------------ //
170
    .v-min-max-text-field {
171
        @include composite-field-wrapper;
172
    }
173
    
174
    // ------------ v-geolocation-field ------------- //
175
    .v-geolocation-field {
176
        .wrapper{
177
          @include composite-field-wrapper;
178
        }
179
        .map-wrapper {
180
            .v-label {
181
              position: absolute;
182
              color: black;
183
              margin-left: 60px;
184
              z-index: 1000;
185
              font-weight: bold;
186
              background-color: white;
187
              border-radius: $v-border-radius;
188
            }
189
            .v-leaflet{
190
              position: absolute;
191
              .leaflet-container{
192
                  border-radius: $v-border-radius;
193
                  margin-left: 10px;
194
              }
195
            }
196
          }
197
    }
198
} 
(1-1/5)