summaryrefslogtreecommitdiff
path: root/app/assets/stylesheets/page_bundles/merge_conflicts.scss
blob: 9fe56fd337fe4604a6d8ff2caec07718d5e6c2b5 (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
@import 'mixins_and_variables_and_functions';
@import '../highlight/conflict_colors';

@mixin color-scheme($color) {
  .header.line_content,
  .diff-line-num {
    &.origin {
      background-color: map-get($conflict-colors, #{$color}-header-origin-neutral);
      border-color: map-get($conflict-colors, #{$color}-header-origin-neutral);

      button {
        background-color: map-get($conflict-colors, #{$color}-button-origin-neutral);
        border-color: darken(map-get($conflict-colors, #{$color}-button-origin-neutral), 15);
      }

      &.selected {
        background-color: map-get($conflict-colors, #{$color}-header-origin-chosen);
        border-color: map-get($conflict-colors, #{$color}-header-origin-chosen);

        button {
          background-color: map-get($conflict-colors, #{$color}-button-origin-chosen);
          border-color: darken(map-get($conflict-colors, #{$color}-button-origin-chosen), 15);
        }
      }

      &.unselected {
        background-color: map-get($conflict-colors, #{$color}-header-not-chosen);
        border-color: map-get($conflict-colors, #{$color}-header-not-chosen);

        button {
          background-color: lighten(map-get($conflict-colors, #{$color}-button-origin-neutral), 15);
          border-color: map-get($conflict-colors, #{$color}-button-origin-neutral);
        }
      }
    }

    &.head {
      background-color: map-get($conflict-colors, #{$color}-header-head-neutral);
      border-color: map-get($conflict-colors, #{$color}-header-head-neutral);

      button {
        background-color: map-get($conflict-colors, #{$color}-button-head-neutral);
        border-color: darken(map-get($conflict-colors, #{$color}-button-head-neutral), 15);
      }

      &.selected {
        background-color: map-get($conflict-colors, #{$color}-header-head-chosen);
        border-color: map-get($conflict-colors, #{$color}-header-head-chosen);

        button {
          background-color: map-get($conflict-colors, #{$color}-button-head-chosen);
          border-color: darken(map-get($conflict-colors, #{$color}-button-head-chosen), 15);
        }
      }

      &.unselected {
        background-color: map-get($conflict-colors, #{$color}-header-not-chosen);
        border-color: map-get($conflict-colors, #{$color}-header-not-chosen);

        button {
          background-color: lighten(map-get($conflict-colors, #{$color}-button-head-neutral), 15);
          border-color: map-get($conflict-colors, #{$color}-button-head-neutral);
        }
      }
    }
  }

  .line_content {
    &.origin {
      background-color: map-get($conflict-colors, #{$color}-line-origin-neutral);

      &.selected {
        background-color: map-get($conflict-colors, #{$color}-line-origin-chosen);
      }

      &.unselected {
        background-color: map-get($conflict-colors, #{$color}-line-not-chosen);
      }
    }

    &.head {
      background-color: map-get($conflict-colors, #{$color}-line-head-neutral);

      &.selected {
        background-color: map-get($conflict-colors, #{$color}-line-head-chosen);
      }

      &.unselected {
        background-color: map-get($conflict-colors, #{$color}-line-not-chosen);
      }
    }
  }
}

#conflicts {
  .white {
    @include color-scheme('white'); }

  .dark {
    @include color-scheme('dark'); }

  .monokai {
    @include color-scheme('monokai'); }

  .solarized-light {
    @include color-scheme('solarized-light'); }

  .solarized-dark {
    @include color-scheme('solarized-dark'); }

  .none {
    .line_content.header {
      button {
        color: $gray-900;
      }
    }
  }

  .diff-wrap-lines .line_content {
    white-space: normal;
    min-height: 19px;
  }

  .line_content.header {
    position: relative;

    button {
      border-radius: 2px;
      font-size: 10px;
      position: absolute;
      right: 10px;
      padding: 0;
      outline: none;
      color: var(--white, $white);
      width: 75px; // static width to make 2 buttons have same width
      height: 19px;
    }
  }

  .editor-wrap {
    &.is-loading {
      .editor {
        display: none;
      }

      .loading {
        display: block;
      }
    }

    &.saved {
      .editor {
        border-top: solid 2px var(--green-300, $green-300);
      }
    }

    .editor {
      pre {
        height: 350px;
        border: 0;
        border-radius: 0;
        margin-bottom: 0;
      }
    }

    .loading {
      display: none;
    }
  }

  .discard-changes-alert {
    background-color: var(--gray-10, $gray-10);
    text-align: right;
    padding: $gl-padding-top $gl-padding;
    color: var(--gl-text-color, $gl-text-color);
  }
}