Skip to content

Commit 6b82e85

Browse files
committed
Add the Reset button
1 parent 6901378 commit 6b82e85

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed

css/cloudinary.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/images/undo.svg

Lines changed: 3 additions & 0 deletions
Loading

php/ui/component/class-crops.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ protected function make_input( $name, $value ) {
313313
$clear_button['attributes']['type'] = 'button';
314314
$clear_button['attributes']['class'][] = 'button';
315315
$clear_button['attributes']['class'][] = 'clear-crop-input';
316-
$clear_button['attributes']['title'] = __( 'Clear input', 'cloudinary' );
317-
$clear_button['content'] = __( 'Clear', 'cloudinary' );
316+
$clear_button['attributes']['title'] = __( 'Reset input', 'cloudinary' );
317+
$clear_button['content'] = Utils::get_inline_svg( 'css/images/undo.svg', false ) . '<span>' . __( 'Reset', 'cloudinary' ) . '</span>';
318318

319319
$wrapper['children']['input'] = $input;
320320
$wrapper['children']['button'] = $clear_button;

src/css/components/ui/_sizes-preview.scss

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,52 @@
8989
opacity: 0.5;
9090
}
9191

92+
.disable-toggle {
93+
margin: 0;
94+
}
95+
96+
.button.clear-crop-input {
97+
display: inline-flex;
98+
align-items: center;
99+
gap: 6px;
100+
background: transparent;
101+
border: none;
102+
color: $color-cld-blue;
103+
padding: 0;
104+
cursor: pointer;
105+
box-shadow: none;
106+
font-size: 14px;
107+
font-weight: 600;
108+
margin-right: 40px;
109+
110+
svg {
111+
width: 16px;
112+
height: 16px;
113+
fill: currentColor;
114+
}
115+
116+
&:hover {
117+
background: transparent;
118+
opacity: 0.8;
119+
}
120+
121+
&:focus {
122+
box-shadow: none;
123+
outline: none;
124+
}
125+
}
126+
92127
}
93128

94129
&-size-selector {
95130
display: flex;
96131
flex-wrap: nowrap;
97-
overflow-y: scroll;
132+
overflow-x: scroll;
98133
scrollbar-width: thin;
99134
border: 1px solid $color-light-grey;
100135
border-radius: 4px;
136+
width: fit-content;
137+
max-width: 100%;
101138

102139
margin-bottom: 42px;
103140
padding: 4px;

0 commit comments

Comments
 (0)