Project

General

Profile

Download (6.28 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: relative;
23
        @if $button-alignment == 'left' {
24
            left: $button-width + 1px;
25
        }
26
        @if $button-alignment == 'right' {
27
            right: $button-width * $button-count + 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
  
39
    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

    
61
// ===================== Styles ===================== //
62

    
63
body .edit-valo { // increasing specifity to allow overriding the valo default field themes
64
  
65
  .composite-field-wrapper {
66
        @include composite-field-wrapper;
67
    }
68
  
69
  // ------------  TimePeriodField ------------ //
70
  .v-time-period-field {
71
      .margin-wrapper {
72
          @include composite-field-wrapper;
73
      }
74
      .to-label {
75
        padding: 0 round($v-unit-size / 2);
76
      }
77
  }
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
   }
89
  
90
  // ------------ v-switchable-textfield ------------ //
91
  .v-switchable-textfield {
92
    @include icon-button-field('v-textfield', 'v-switch', 1, 'right');
93
    .v-switch {
94
        top: round($v-unit-size * 0.75);
95
        right: round($v-unit-size / 4);
96
        position: absolute !important; // this is a temporary fix for the issue https://dev.e-taxonomy.eu/redmine/issues/8035
97
    }
98
  }
99
  
100
  // ------------ 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
  // ------------ v-person-field ------------ //
112
  .v-person-field {
113
    position: relative;
114
    margin-bottom: $edit-v-shadow-spread-radius ;
115
    .v-caption {
116
        display: block;
117
    }
118
    .cache-field, .details-fields  {
119
        padding-right: round($v-unit-size * 1.5);
120
    }
121
    .v-switch {
122
        z-index: 10;
123
        position: absolute;
124
        right: $edit-v-shadow-spread-radius; // boxshadow width (3px) from $v-shadow,
125
        top: $edit-v-shadow-spread-radius + 1px; // boxshadow width (3px) + 1 
126
    }
127
    .nomenclatural-title {
128
        margin-top: $edit-v-shadow-spread-radius;
129
    }
130
  }
131
  .v-person-field-cache-mode {
132
        .cache-field {
133
            display: block;
134
        }
135
        .details-fields {
136
            display: none;
137
        }
138
    }
139
   .v-person-field-details-mode {
140
        .cache-field {
141
            display: none;
142
        }
143
        .details-fields {
144
            display: block;
145
        }
146
    }
147
    
148
   // ------------ team-or-person-field ------------ // 
149
   .v-team-or-person-field {
150
   
151
        .toolbar {
152
            float: right;
153
            height: $v-unit-size;
154
        }
155
        .margin-wrapper {
156
            @include composite-field-wrapper;
157
            
158
        }
159
    }
160
    
161
    // ------------ v-related-entity-list-select ------------ //
162

    
163
    .v-related-entity-list-select {
164
        @include icon-button-field('v-select', 'v-button', 2, 'right', $v-unit-size);
165
    }
166
    
167
    // ------------ v-related-entity-combobox ------------ //
168
    .v-related-entity-combobox {
169
        $buttons-count: 2;    
170
        @include icon-button-field('v-filterselect', 'v-button', $buttons-count, 'right', $v-unit-size);
171
        padding-right: $edit-v-shadow-spread-radius * 2 * $buttons-count;
172
        .v-filterselect-button {
173
            right: $v-unit-size * 2 + 1px;
174
        }
175
        .v-component-group {
176
          .v-required-field-indicator {
177
              // no not show the indicator of the nested select
178
              display: none;
179
          }
180
          .v-errorindicator {
181
             // no not show the indicator of the nested select
182
              display: none;
183
          }
184
        }
185
    }
186
    
187
    // ------------ minMaxTextField ------------ //
188
    .v-min-max-text-field {
189
        @include composite-field-wrapper;
190
    }
191
    
192
    // ------------ v-geolocation-field ------------- //
193
    .v-geolocation-field {
194
        .wrapper{
195
          @include composite-field-wrapper;
196
        }
197
        .map-wrapper {
198
            .v-label {
199
              position: absolute;
200
              color: black;
201
              margin-left: 60px;
202
              z-index: 1000;
203
              font-weight: bold;
204
              background-color: white;
205
              border-radius: $v-border-radius;
206
            }
207
            .v-leaflet{
208
              position: absolute;
209
              .leaflet-container{
210
                  border-radius: $v-border-radius;
211
                  margin-left: 10px;
212
              }
213
            }
214
          }
215
    }
216
} 
(1-1/5)