File tree Expand file tree Collapse file tree 5 files changed +59
-25
lines changed Expand file tree Collapse file tree 5 files changed +59
-25
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ class NewSnippet extends React.Component {
30
30
e . preventDefault ( ) ;
31
31
}
32
32
} ;
33
+ this . recalcLangHeaderHeight = ( ) => {
34
+ const newSnippetHeaderHeight = document . getElementsByClassName ( 'new-snippet-code-header' ) [ 0 ] . offsetHeight ;
35
+
36
+ document . getElementsByClassName ( 'new-snippet-lang-header' ) [ 0 ]
37
+ . setAttribute ( 'style' , `height:${ newSnippetHeaderHeight } px` ) ;
38
+ } ;
33
39
this . postSnippet = this . postSnippet . bind ( this ) ;
34
40
this . onSyntaxClick = this . onSyntaxClick . bind ( this ) ;
35
41
this . onInputChange = this . onInputChange . bind ( this ) ;
@@ -43,11 +49,15 @@ class NewSnippet extends React.Component {
43
49
}
44
50
45
51
onTagAdded ( tag ) {
46
- this . setState ( { tags : [ ...this . state . tags , tag ] } ) ;
52
+ this . setState ( { tags : [ ...this . state . tags , tag ] } , ( ) => {
53
+ this . recalcLangHeaderHeight ( ) ;
54
+ } ) ;
47
55
}
48
56
49
57
onTagRemoved ( tag ) {
50
- this . setState ( { tags : this . state . tags . filter ( item => item !== tag ) } ) ;
58
+ this . setState ( { tags : this . state . tags . filter ( item => item !== tag ) } , ( ) => {
59
+ this . recalcLangHeaderHeight ( ) ;
60
+ } ) ;
51
61
}
52
62
53
63
onSyntaxClick ( syntax ) {
Original file line number Diff line number Diff line change @@ -12,13 +12,12 @@ lang-bar-width = 230px
12
12
& -code ,
13
13
& -lang
14
14
& -header
15
- padding : 16px 20px 19px
16
- box-sizing : border-box
17
15
display : flex
18
16
flex-flow : row nowrap
19
- height : offset
20
17
min-height : offset
21
- align-items : flex-end
18
+ align-items : flex-start
19
+ padding : 20px 20px 19px
20
+ box-sizing : border-box
22
21
23
22
& -code
24
23
flex : 1
@@ -34,6 +33,8 @@ lang-bar-width = 230px
34
33
.input
35
34
basic-input ()
36
35
width : 47%
36
+ border-radius : 3px
37
+ background-color : snippet-header-normal
37
38
& > input
38
39
margin-right : 5%
39
40
& -bottom-bar
@@ -45,19 +46,17 @@ lang-bar-width = 230px
45
46
padding : 5px
46
47
border-top : 1px solid border-light
47
48
& > input
49
+ min-width : 200px
50
+ padding : 11px
51
+ margin : 5px 16px 7px 0
48
52
border : none
49
- background-color : button-normal
53
+ background-color : snippet-post-button
50
54
color : text - light
51
- padding : 11px
52
- margin-right : 16px
53
- margin-bottom : 7px
54
- margin-top : 5px
55
55
font-size : 15px
56
56
text-align : center
57
- min-width : 200px
58
57
& :hover ,
59
58
& :focus
60
- background-color : button-active
59
+ background-color : snippet-post- button-active
61
60
cursor : pointer
62
61
63
62
& -lang
@@ -70,6 +69,8 @@ lang-bar-width = 230px
70
69
background-color : snippet-header-normal
71
70
.input
72
71
basic-input ()
72
+ border-radius : 3px
73
+ background-color : snippet-header-lang-input-bg
73
74
& -list
74
75
height : 100%
75
76
& -wrapper
@@ -81,14 +82,17 @@ lang-bar-width = 230px
81
82
color : text - grey
82
83
& -item
83
84
margin-top : - 1px
85
+ padding : 16px 15px
84
86
font-size : 14px
85
- padding : 15px
87
+ font-family : font-roboto
88
+ font-weight : 300
89
+ letter-spacing : .2px
86
90
border-left : 5px solid language-bar-border
87
91
border-bottom : 1px solid language-bar-border
88
92
cursor : pointer
89
93
& :hover ,
90
94
& .active
91
- padding-bottom : 16 px
95
+ padding-bottom : 17 px
92
96
border-left : 5px solid snippet-border
93
97
border-bottom : none
94
98
background-color : language-bar-bg-active
Original file line number Diff line number Diff line change 2
2
3
3
basic-input ()
4
4
width : 100%
5
- background-color : transparent
5
+ padding : 7 px 5 px
6
6
border : none
7
- border-bottom : 1px solid rgba (text-light, .4 )
8
7
outline : none
9
8
color : text - light
10
- font-size : 15px
11
- font-family : font-quicksand
9
+ font-family : font-roboto
10
+ font-size : 13px
11
+ font-weight : 300
12
12
letter-spacing : - .3px
13
+ & :focus
14
+ & :: placeholder
15
+ color : rgba (text-light, .8 )
13
16
& :: placeholder
14
17
color : rgba (text-light, .6 )
15
- & :focus
16
- border-bottom : 1px solid text - light
Original file line number Diff line number Diff line change 20
20
21
21
.react-tags
22
22
display : flex
23
+ flex-flow : row wrap
24
+ basic-input ()
23
25
width : 47%
26
+ border-radius : 3px
27
+ background-color : snippet-header-normal
24
28
input
25
29
basic-input ()
30
+ padding : 0
31
+ border-radius : 3px
32
+ background-color : snippet-header-normal
26
33
.react-tags__container
27
34
display : flex
35
+ flex-flow : row wrap
28
36
color : text - light
29
37
li
30
- border : 1px solid rgba (text-light, .4 )
31
- margin-right : 4px
32
- padding : 7px
38
+ margin : 0 4px 5px 0
39
+ padding : 0 8px
40
+ font-size : 12px
41
+ font-weight : 300
42
+ line-height : 20px
43
+ color : text - light
44
+ border-radius : 9.5px
45
+ background-color : rgba (snippet-header-light, .7 )
46
+ letter-spacing : 0.4px
33
47
white-space : nowrap
48
+ & : last-shild
49
+ margin-right : 0
34
50
& :hover
35
51
border-color : text - light
36
52
a
Original file line number Diff line number Diff line change @@ -21,8 +21,11 @@ sidebar-active-icon = color-puerto-rico-green-s47
21
21
sidebar-normal-icon = color-dim-gray-gray-s0
22
22
23
23
snippet-header-normal = color-niagara-green-s75
24
- snippet-header-light = color-medium-aquamarine-blue-s47
24
+ snippet-header-light = color-shamrock-green-s73
25
25
snippet-header-border = color-mountain-meadow-green-s89
26
+ snippet-header-lang-input-bg = color-elf-green-green-s82
27
+ snippet-post-button = color-shamrock-green-s73
28
+ snippet-post-button-active = color-mountain-meadow-green-s89
26
29
27
30
snippet-header-green-normal = color-shamrock-green-s73
28
31
snippet-content-light = color-white-white-s100
You can’t perform that action at this time.
0 commit comments