Skip to content

Commit deb6f19

Browse files
committed
Increase padding around icons in large inputs
1 parent 0e26e59 commit deb6f19

File tree

2 files changed

+52
-32
lines changed
  • packages/react-components/source

2 files changed

+52
-32
lines changed

packages/react-components/source/react/library/input/Input.md

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ const exampleStyle = { marginBottom: 10 };
138138
name="input-ex11"
139139
value={state['input-ex11-value']}
140140
icon="search"
141+
shape="oval"
141142
placeholder="Search for stuff"
142143
style={exampleStyle}
143144
onChange={value => setState({ 'input-ex11-value': value })}

packages/react-components/source/scss/library/components/forms/_input.scss

+51-32
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@
5454
border-radius: 80px;
5555
}
5656

57-
.rc-input-medium {
57+
.rc-input-container-medium .rc-input {
5858
padding: 5px 7px;
5959
}
6060

61-
.rc-input-large {
61+
.rc-input-container-large .rc-input {
6262
padding: 10px;
6363
}
6464

@@ -71,43 +71,62 @@
7171
.rc-input-container {
7272
flex-grow: 1;
7373
position: relative;
74-
}
7574

76-
.rc-input-icon {
77-
position: absolute;
78-
top: 50%;
79-
transform: translateY(-50%);
80-
}
75+
.rc-input-icon {
76+
position: absolute;
77+
top: 50%;
78+
transform: translateY(-50%);
79+
}
8180

82-
.rc-input-icon.leading {
83-
left: $puppet-common-spacing-base * 2;
84-
}
81+
.rc-input-icon.leading {
82+
left: $puppet-common-spacing-base * 2;
83+
}
8584

86-
.rc-input-icon.trailing {
87-
right: $puppet-common-spacing-base * 2;
88-
}
85+
.rc-input-icon.trailing {
86+
right: $puppet-common-spacing-base * 2;
87+
}
8988

90-
.rc-input-icon.trailing.edge {
91-
right: $puppet-common-spacing-base * 0;
92-
}
89+
.rc-input-icon.trailing.edge {
90+
right: $puppet-common-spacing-base * 0;
91+
}
9392

94-
.rc-input-icon.trailing.with-trailing-button {
95-
right: $puppet-common-spacing-base * 9;
96-
}
93+
.rc-input-icon.trailing.with-trailing-button {
94+
right: $puppet-common-spacing-base * 9;
95+
}
9796

98-
.rc-input-icon.leading ~ .rc-input {
99-
padding-left: 31px;
100-
}
97+
.rc-input-icon.leading ~ .rc-input {
98+
padding-left: 31px;
99+
}
101100

102-
.rc-input-icon.trailing ~ .rc-input {
103-
padding-right: 31px;
104-
}
101+
.rc-input-icon.trailing ~ .rc-input {
102+
padding-right: 31px;
103+
}
105104

106-
.rc-input-button-icon {
107-
border: hidden;
108-
}
105+
.rc-input-button-icon {
106+
border: hidden;
107+
}
109108

110-
.rc-input-button-icon:hover {
111-
background: inherit;
112-
border: hidden;
109+
.rc-input-button-icon:hover {
110+
background: inherit;
111+
border: hidden;
112+
}
113+
114+
// Increase padding around icons in large inputs
115+
&.rc-input-container-large {
116+
.rc-input-icon.leading {
117+
left: $puppet-common-spacing-base * 4 - 1;
118+
}
119+
120+
.rc-input-icon.leading ~ .rc-input {
121+
padding-left: $puppet-common-spacing-base * 10 - 1;
122+
}
123+
124+
.rc-input-icon.trailing {
125+
right: $puppet-common-spacing-base * 4 - 1;
126+
}
127+
128+
.rc-input-icon.trailing ~ .rc-input {
129+
padding-right: $puppet-common-spacing-base * 10 - 1;
130+
}
131+
}
113132
}

0 commit comments

Comments
 (0)