summaryrefslogtreecommitdiffstats
path: root/WebContent/VAADIN/themes/runo/grid/grid.scss
blob: 204dc4c3f2c4b5ed2256dbef75f5390e03a5c999 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
@mixin runo-grid($primary-stylename : v-grid) {
  
  $grid-border-main: 1px solid #b6bbbc;
  $grid-border-active: 1px solid #57a7ed;
  
  .#{$primary-stylename} {
    outline: none;
  }
  
  .#{$primary-stylename}-tablewrapper {
    @include box-sizing(border-box);
    border: $grid-border-main;
  }
  
  .#{$primary-stylename}-cell.frozen {
    /* TODO this probably should be a SCSS mixin */
    -webkit-box-shadow: 2px 0 2px rgba(0, 0, 0, 0.1);
    box-shadow: 2px 0 2px rgba(0, 0, 0, 0.1);
  }
  
  // Grid header.
  .#{$primary-stylename}-header, .#{$primary-stylename}-footer {
    
    .#{$primary-stylename}-cell {
      color: #393a3c;
      background: #e7e9ea url(img/header-bg.png) repeat-x;
      border: none;
      font-size: 15px;
      font-weight: normal;
      padding: 9px 2px 9px 6px;
      position: relative;
      text-shadow: #ffffff 0 1px 0;
      
      &:first-child {
        &:before, &:after {
          content: none;
        }
      }
      
      &:before {
        background-image: url(img/resizer-bg.png);
        content: "";
        height: 100%;
        left: 0;
        top: 0;
        width: 2px;
        position: absolute;
      }
    }
    
    .#{$primary-stylename}-cell-active {
        border: $grid-border-active;
    }
  }
  
  .#{$primary-stylename}-header {
    .#{$primary-stylename}-cell {
      border-bottom: $grid-border-main;
    }

    .#{$primary-stylename}-cell-active {
        padding: 8px 1px 9px 5px;
    }
  }
  
  .#{$primary-stylename}-footer {
    .#{$primary-stylename}-cell {
      border-top: $grid-border-main;
    }
    
    .#{$primary-stylename}-cell-active {
        padding: 9px 1px 8px 5px;
    }
  }
  
  .#{$primary-stylename}-header .#{$primary-stylename}-cell-active {
    border-bottom: $grid-border-active;
  }
  
  .#{$primary-stylename}-footer .#{$primary-stylename}-cell-active {
    border-top: $grid-border-active;
  }
  
  // Sort indicators
  .#{$primary-stylename} th.sort-asc:after,
  .#{$primary-stylename} th.sort-desc:after {
    content: attr(sort-order);
    height: 36px;
    position: absolute;
    right: 0;
    top: 0;
    width: 20px;
  }
  
  .#{$primary-stylename} th.#{$primary-stylename}-cell-active.sort-asc:after,
  .#{$primary-stylename} th.#{$primary-stylename}-cell-active.sort-desc:after {
    right: -1px;
    top: -1px;
  }
  
  .#{$primary-stylename} th.sort-asc:after {
    background: transparent url(img/sort-asc.png) no-repeat right 50%;
  }
  
  .#{$primary-stylename} th.sort-desc:after {
    background: transparent url(img/sort-desc.png) no-repeat right 50%;
  }
  
  // Grid body
  .#{$primary-stylename}-body {
    
    .#{$primary-stylename}-row-stripe > .#{$primary-stylename}-cell {
      background-color: #f6f7f7;
    }
    
    // Cells
    .#{$primary-stylename}-cell {
      border: none;
      line-height: 23px;
      padding: 3px 6px 0 6px;
    }
    
    // Active state
    .#{$primary-stylename}-row-active {
      
      .#{$primary-stylename}-cell {
        background: #edeeee;
      }
      
      .#{$primary-stylename}-cell-active {
        border: $grid-border-active;
      
        // Adjust padding for 'active' border.
        padding: 2px 5px 0 5px;
      }
    }
    
    // Selected state
    .#{$primary-stylename}-row.#{$primary-stylename}-row-selected {
      color: white;
      
      .#{$primary-stylename}-cell {
        background-color: #57a7ed;
      }
      
      .#{$primary-stylename}-cell-active {
        border-color: #489ade;
      }
    }
    
    .#{$primary-stylename}-row-active.#{$primary-stylename}-row-selected > .#{$primary-stylename}-cell {
        background: #3a90d3;
    }
    
  }
  
  // Scrollbars
  .#{$primary-stylename}-scroller {
    @include box-sizing(border-box);
    outline: none;
  }
  
  .#{$primary-stylename}-scroller-vertical {
    border-top: $grid-border-main;
    border-bottom: $grid-border-main;
  }
  
  .#{$primary-stylename}-scroller-horizontal {
    border-left: $grid-border-main;
    border-right: $grid-border-main;
  }
  
  // Fillers
  .#{$primary-stylename}-horizontalscrollbarbackground,
  .#{$primary-stylename}-footercorner,
  .#{$primary-stylename}-headercorner {
    @include box-sizing(border-box);
    border: $grid-border-main;
  }

  .#{$primary-stylename}-footercorner,
  .#{$primary-stylename}-headercorner {
    background: #e7e9ea url(img/header-bg.png) repeat-x;
    border-left: 0;
  }

  .#{$primary-stylename}-footercorner {
    border-top: 0;
  }
  
  .#{$primary-stylename}-headercorner {
    border-bottom: 0;
  }
      
  .#{$primary-stylename}-horizontalscrollbarbackground {
    background-color: #edeeee;
    border-top: 0;
  }
}

@mixin box-sizing($value) {
  box-sizing: $value;
  -moz-box-sizing: $value;
  -webkit-box-sizing: $value;
}