Project

General

Profile

Download (6.13 KB) Statistics
| Branch: | Tag: | Revision:
1 2260591f Andreas Kohlbecker
// styles for custom fields
2
3 bc5816ee Andreas Kohlbecker
// ===================== 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 1c17a795 Andreas Kohlbecker
@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 403a0ebd Andreas Kohlbecker
        position: relative;
23 1c17a795 Andreas Kohlbecker
        @if $button-alignment == 'left' {
24 403a0ebd Andreas Kohlbecker
            left: $button-width + 1px;
25 1c17a795 Andreas Kohlbecker
        }
26
        @if $button-alignment == 'right' {
27 403a0ebd Andreas Kohlbecker
            right: $button-width * $button-count + 1px;
28 1c17a795 Andreas Kohlbecker
        }
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 403a0ebd Andreas Kohlbecker
  
39 1c17a795 Andreas Kohlbecker
    position: relative; // needs to be a positioned element
40
    height: $v-line-height * 2;
41
    .v-caption {
42
        display: block;
43
    }   
44
    .#{$field-stylename} {
45
        @if $button-alignment == 'left' {
46
            padding-left: $button-count * $button-width; 
47
        }
48
        @if $button-alignment == 'right' {
49
            $more-padding: 0px;
50
            @if $field-stylename == 'v-select' {
51
                $more-padding: 8px;
52
            }
53
            padding-right: $button-count * $button-width + $more-padding; 
54
        }        
55
    }
56
    // recursive include
57
    @include icon-button-field-button($button-style-name, $button-count, $button-alignment, $button-width);
58
}
59
60 65ac8231 Andreas Kohlbecker
61 cfabbeb0 Andreas Kohlbecker
// ===================== Styles ===================== //
62 bc5816ee Andreas Kohlbecker
63 9c553d89 Andreas Kohlbecker
body .edit-valo { // increasing specifity to allow overriding the valo default field themes
64
  
65 4a3c0817 Andreas Kohlbecker
  .composite-field-wrapper {
66
        @include composite-field-wrapper;
67
    }
68
  
69 cfabbeb0 Andreas Kohlbecker
  // ------------  TimePeriodField ------------ //
70 9c553d89 Andreas Kohlbecker
  .v-time-period-field {
71
      .margin-wrapper {
72 bc5816ee Andreas Kohlbecker
          @include composite-field-wrapper;
73 9c553d89 Andreas Kohlbecker
      }
74 2921c66d Andreas Kohlbecker
      .to-label {
75
        padding: 0 round($v-unit-size / 2);
76
      }
77 9c553d89 Andreas Kohlbecker
  }
78
  
79
  .v-textfield-helper-field { 
80
          @if is-dark-color($v-background-color) {
81
              $helper-color: lighten($v-background-color, 20%);
82
          } @else {
83
              $helper-color: lighten($v-background-color, -20%);
84
          }
85
          color: $helper-color;
86
          background-color: valo-font-color($helper-color);
87
          border-radius: $v-border-radius;
88 cd29f770 Andreas Kohlbecker
   }
89
  
90 cfabbeb0 Andreas Kohlbecker
  // ------------ v-switchable-textfield ------------ //
91 cd29f770 Andreas Kohlbecker
  .v-switchable-textfield {
92 1c17a795 Andreas Kohlbecker
    @include icon-button-field('v-textfield', 'v-switch', 1, 'right');
93 93a60750 Andreas Kohlbecker
    .v-switch {
94
        top: round($v-unit-size * 0.75);
95
        right: round($v-unit-size / 4);
96 d0237f32 Andreas Kohlbecker
        position: absolute !important; // this is a temporary fix for the issue https://dev.e-taxonomy.eu/redmine/issues/8035
97 240a4ed8 Andreas Kohlbecker
    }
98 cd29f770 Andreas Kohlbecker
  }
99 bc5816ee Andreas Kohlbecker
  
100 904cd1c0 Andreas Kohlbecker
  // ------------ NameRelationField ------------ //
101
  .v-name-relation-field {
102
      .toolbar {
103
            float: right;
104
            height: $v-unit-size;
105
      }
106
      .margin-wrapper {
107
          @include composite-field-wrapper;
108
      }
109
  }
110
  
111 cfabbeb0 Andreas Kohlbecker
  // ------------ v-person-field ------------ //
112 bc5816ee Andreas Kohlbecker
  .v-person-field {
113 05ce2673 Andreas Kohlbecker
    position: relative;
114 bc5816ee Andreas Kohlbecker
    .v-caption {
115
        display: block;
116
    }
117
    .cache-field, .details-fields  {
118 05ce2673 Andreas Kohlbecker
        padding-right: round($v-unit-size * 1.5);
119 bc5816ee Andreas Kohlbecker
    }
120
    .v-switch {
121
        z-index: 10;
122
        position: absolute;
123 05ce2673 Andreas Kohlbecker
        right: 3px; // boxshadow width (3px) from $v-shadow, TODO extract value from variable?
124
        top: 4px; // boxshadow width (3px) + 1 
125 bc5816ee Andreas Kohlbecker
    } 
126
  }
127
  .v-person-field-cache-mode {
128
        .cache-field {
129
            display: block;
130
        }
131
        .details-fields {
132
            display: none;
133
        }
134
    }
135
   .v-person-field-details-mode {
136
        .cache-field {
137
            display: none;
138
        }
139
        .details-fields {
140
            display: block;
141
        }
142
    }
143
    
144 cfabbeb0 Andreas Kohlbecker
   // ------------ team-or-person-field ------------ // 
145 bc5816ee Andreas Kohlbecker
   .v-team-or-person-field {
146 d574f7e6 Andreas Kohlbecker
   
147
        .toolbar {
148
            float: right;
149
            height: $v-unit-size;
150
        }
151 bc5816ee Andreas Kohlbecker
        .margin-wrapper {
152
            @include composite-field-wrapper;
153 d574f7e6 Andreas Kohlbecker
            
154 bc5816ee Andreas Kohlbecker
        }
155
    }
156 1c17a795 Andreas Kohlbecker
    
157 cfabbeb0 Andreas Kohlbecker
    // ------------ v-related-entity-list-select ------------ //
158
159 1c17a795 Andreas Kohlbecker
    .v-related-entity-list-select {
160 bef42c71 Andreas Kohlbecker
        @include icon-button-field('v-select', 'v-button', 2, 'right', $v-unit-size);
161
    }
162
    
163 cfabbeb0 Andreas Kohlbecker
    // ------------ v-related-entity-combobox ------------ //
164 bef42c71 Andreas Kohlbecker
    .v-related-entity-combobox {
165 403a0ebd Andreas Kohlbecker
        $buttons-count: 2;    
166
        @include icon-button-field('v-filterselect', 'v-button', $buttons-count, 'right', $v-unit-size);
167
        padding-right: $edit-v-shadow-spread-radius * 2 * $buttons-count;
168 bef42c71 Andreas Kohlbecker
        .v-filterselect-button {
169
            right: $v-unit-size * 2 + 1px;
170
        }
171 98a2455f Andreas Kohlbecker
        .v-component-group {
172
          .v-required-field-indicator {
173
              // no not show the indicator of the nested select
174
              display: none;
175
          }
176
          .v-errorindicator {
177
             // no not show the indicator of the nested select
178
              display: none;
179
          }
180
        }
181 1c17a795 Andreas Kohlbecker
    }
182
    
183 cfabbeb0 Andreas Kohlbecker
    // ------------ minMaxTextField ------------ //
184
    .v-min-max-text-field {
185
        @include composite-field-wrapper;
186
    }
187
    
188 f68f9e94 Andreas Kohlbecker
    // ------------ v-geolocation-field ------------- //
189
    .v-geolocation-field {
190
        .wrapper{
191
          @include composite-field-wrapper;
192
        }
193 475e401d Andreas Kohlbecker
        .map-wrapper {
194
            .v-label {
195
              position: absolute;
196
              color: black;
197
              margin-left: 60px;
198 0748ebca Andreas Kohlbecker
              z-index: 1000;
199
              font-weight: bold;
200
              background-color: white;
201
              border-radius: $v-border-radius;
202 475e401d Andreas Kohlbecker
            }
203
            .v-leaflet{
204
              position: absolute;
205
              .leaflet-container{
206
                  border-radius: $v-border-radius;
207
                  margin-left: 10px;
208
              }
209
            }
210
          }
211
    }
212 9c553d89 Andreas Kohlbecker
}