Skip to content

Commit 6cbc960

Browse files
committed
Merge pull request #761 from saharj/newStyle
[less] Refactor Less variables in editor, header, schema-model and se…
2 parents 1a1ef39 + 8eea3e3 commit 6cbc960

18 files changed

+134
-68
lines changed

app/styles/buttons.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ button {
1515

1616

1717
button.border-only {
18-
background: white;
18+
background: @white;
1919

2020
&:hover {
2121
background-color: lighten(@gray-md, 47%);
@@ -24,7 +24,7 @@ button.border-only {
2424

2525
&.red:hover {
2626
background: @sw-error-header;
27-
color: white;
27+
color: @white;
2828
}
2929
}
3030

@@ -34,7 +34,7 @@ button.call {
3434
display: inline-block;
3535
border:1px solid @gray-lt;
3636
background-color: @gray-lt;
37-
color: #444;
37+
color: @call-button;
3838
border-radius: 3px;
3939
appearance: none;
4040
cursor: pointer;

app/styles/colors.less

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
// UI Colors
22
@header-bg: #4a4a4a;
33
@sw-error-header: #FF081C;
4+
@sw-success-header: #90C78F;
45
@error-text: #FF081C;
56
@overlay-text: #F8A81C;
7+
@main-splitbar: #5E696B;
8+
@dragover-dash: #138BC4;
9+
@links: #4183c4;
10+
@hr-color: #ddd;
611

712

813
// Toolbar
@@ -24,6 +29,14 @@
2429
@gray-lt: #E3E3E3;
2530
@gray-md: #808080;
2631
@gray-dk: #333333;
32+
@gray: #ccc;
33+
34+
// Colors
35+
@white: white;
36+
@black: black;
37+
@silver: silver;
38+
@red: red;
39+
@green: green;
2740

2841
// Response Code Colors
2942
@code-default: #555;
@@ -34,3 +47,55 @@
3447

3548
// Request Response Background Pane
3649
@pre-bg: #fff7e5;
50+
51+
// Schema Toggle color
52+
@schema-toggle: rgb(66, 90, 66);
53+
54+
// Security Definitions
55+
@authentication-button: rgb(195, 252, 195);
56+
57+
// Security
58+
@security-default: #E5E5E5;
59+
@security-basic: #A8E8A1;
60+
@security-apiKey: #A1B2E8;
61+
@security-oauth2: #F4B487;
62+
63+
// Operation
64+
@background: #fff;
65+
@deprecated-background: #C52A5E;
66+
@table-th: #f7f7f7;
67+
68+
// Intro
69+
@about-pane: rgba(0, 0, 0, .85);
70+
71+
// Drop Down Menu
72+
@drop-down-color: rgba(0, 253, 240, 0.81);
73+
74+
// Modal
75+
@modal-link: rgb(15, 214, 250);
76+
77+
// Tag Colors
78+
@tag-0: #A60000;
79+
@tag-1: #0022A6;
80+
@tag-2: #24A600;
81+
@tag-3: rgb(255, 223, 0);
82+
@tag-4: #990A5B;
83+
@tag-5: #F27D36;
84+
@tag-6: #32FC34;
85+
@tag-7: #00FFEC;
86+
@tag-8: #CD9EED;
87+
@tag-10: #4FB285;
88+
@tag-11: #0D77CF;
89+
@tag-12: #87EA77;
90+
@tag-13: #EDEDED;
91+
@tag-14: #F560FF;
92+
@tag-border: #EBEBEB;
93+
94+
// Try This Operation
95+
@try-operation-warning: #FFF645;
96+
97+
98+
@editor-error: #AA0A0A;
99+
@external-docs: #337ab7;
100+
@dirty-msg: #FFFF6E;
101+
@call-button: #444;

app/styles/components/editor.less

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
@import "../fonts";
2+
@import "../colors";
23

34
.ace-editor{
45
.editor-font;
56
font-size: .8em;
67
.editor-error-message {
78
padding: .3em;
8-
background: #AA0A0A;
9-
color: white;
9+
background: @editor-error;
10+
color: @white;
1011
max-height: 5.6em;
1112
pre {
12-
font-size: 1em;
13+
font-size: 1em;
1314
}
1415
}
1516

app/styles/components/error-presenter.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.sw-font;
77

88
header {
9-
color: white;
9+
color: @white;
1010
cursor: pointer;
1111
margin: 0;
1212

app/styles/components/header.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ a.logo {
2424
.status-bar {
2525
float: right;
2626
padding: 5px;
27-
//TODO: Everything is hardcoded. revisit
27+
2828
.status {
2929
text-align: right;
3030
color: darken(@gray-lt, 25%);
3131
font-weight: 100;
3232
font-size: 12px;
3333

3434
&.success {
35-
color: #90C78F;
35+
color: @sw-success-header;
3636
}
3737
&.error {
3838
color: @sw-error-header;

app/styles/components/intro.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
width: 100%;
88
height: 100%;
99
z-index: 2011;
10-
background: rgba(0, 0, 0, .85);
10+
background: @about-pane;
1111

1212
.modal-header {
1313
position: absolute;

app/styles/components/menu-bar.less

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
user-select: none;
1414
-webkit-user-select: none;
1515
-ms-user-select: none;
16-
color: darken(white, 15%);
16+
color: darken(@white, 15%);
1717
transition: color ease-in 100ms;
1818
}
1919

2020
&:hover {
2121
button, a {
22-
color: white;
22+
color: @white;
2323
}
2424
}
2525

@@ -50,7 +50,7 @@
5050
}
5151

5252
&.highlighted {
53-
color: rgba(0, 253, 240, 0.81);
53+
color: @drop-down-color;
5454
}
5555
}
5656
}
@@ -72,7 +72,7 @@
7272

7373
.dropdown-menu, a, li, button, button:focus {
7474
background: darken(@header-bg, 10%);
75-
color: white;
75+
color: @white;
7676
}
7777

7878
.dropdown-menu {
@@ -94,7 +94,7 @@
9494

9595
&.adjust {
9696
padding: 0px 15px;
97-
border: 1px solid gray;
97+
border: 1px solid @gray-md;
9898
border-radius: 5px;
9999
margin: 0;
100100
display: inline-table;

app/styles/components/modal.less

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.sw-font;
77
border-radius: 3px;
88
background: @gray-dk;
9-
color: #FFF;
9+
color: @white;
1010

1111

1212
.modal-title {
@@ -28,7 +28,7 @@
2828
}
2929

3030
input {
31-
color: black;
31+
color: @black;
3232
padding: 0.2em;
3333
border-radius: 0;
3434
}
@@ -38,11 +38,11 @@
3838
}
3939

4040
select {
41-
color: #000000; // 1
41+
color: @black;
4242
}
4343

4444
a {
45-
color: rgb(15, 214, 250);
45+
color: @modal-link;
4646
}
4747
}
4848

app/styles/components/operation.less

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
.operation-theme(@color) {
77
border: 1px solid @color;
8-
background-color: #fff;
8+
background-color: @background;
99

1010
.http-method{
1111
background-color: @color;
12-
color: white;
12+
color: @white;
1313
}
1414
>header {
1515
background-color: fade(@color, 10%);
@@ -56,10 +56,10 @@ li.operation {
5656
.deprecated {
5757
float: left;
5858
margin: 8px;
59-
color: white;
60-
background: #C52A5E; // TODO: move to colors.less
59+
color: @white;
60+
background: @deprecated-background;
6161
padding: 0px 7px;
62-
border: 1px solid white;
62+
border: 1px solid @white;
6363
}
6464

6565
&:hover .focus-editor {
@@ -133,14 +133,14 @@ li.operation {
133133
>th {
134134
padding: 0.3em;
135135
font-weight: 600;
136-
background-color: #f7f7f7;
136+
background-color: @table-th;
137137
}
138138
}
139139
}
140140

141141
>tbody {
142142
>tr {
143-
border-bottom: 1px solid silver;
143+
border-bottom: 1px solid @silver;
144144
font-size: 16px;
145145

146146
>td {

app/styles/components/path-headers.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
.external-docs {
1919
margin-top: 1em;
20-
a { color: #337ab7; }
20+
a { color: @external-docs; }
2121
}
2222

2323
h1 {

0 commit comments

Comments
 (0)