-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui5-step-input): implement sap_horizon theme #4247
Changes from 12 commits
c9585be
08d3cf3
a714bd8
23927b6
a4aa568
c30fed3
60c47fe
d790bb9
a839991
a54b72e
a8e0a07
d144ec4
7edb1f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
:host { | ||
color: var(--sapField_TextColor); | ||
background-color: var(--sapField_Background); | ||
border: 1px solid var(--sapField_BorderColor); | ||
border: var(--_ui5_step_input_border_style); | ||
border-radius: var(--sapField_BorderCornerRadius); | ||
box-sizing: border-box; | ||
height: var(--_ui5_input_height); | ||
|
@@ -20,17 +20,74 @@ | |
text-align: inherit; | ||
} | ||
|
||
:host(:not([value-state]):not([readonly]):not([disabled])){ | ||
box-shadow: none; | ||
} | ||
|
||
:host([value-state="Success"]:not([readonly]):not([disabled])) { | ||
background-color: var(--sapField_SuccessBackground); | ||
} | ||
|
||
:host([value-state="Error"]:not([readonly]):not([disabled])) { | ||
background-color: var(--sapField_InvalidBackground); | ||
} | ||
|
||
:host([value-state="Information"]:not([readonly]):not([disabled])) { | ||
background-color: var(--sapField_InformationBackground); | ||
} | ||
|
||
:host([value-state="Warning"]:not([readonly]):not([disabled])) { | ||
background-color: var(--sapField_WarningBackground); | ||
} | ||
:host(:not([value-state]):not([readonly]):not([disabled]):hover), | ||
:host([value-state=None]:not([readonly]):not([disabled]):hover) { | ||
background-color: var(--sapField_Hover_Background); | ||
border: 1px solid var(--sapField_Hover_BorderColor); | ||
:host([value-state="None"]:not([readonly]):not([disabled]):hover) { | ||
background-color: var(--_ui5_step_input_border_color_hover); | ||
border: var(--_ui5_step_input_border_hover); | ||
} | ||
:host(:not([value-state]):not([readonly]):not([disabled]):not([focused]):hover), | ||
:host([value-state="None"]:not([readonly]):not([disabled]):not([focused]):hover) { | ||
background-color: var(--sapField_Hover_Background); | ||
border: var(--_ui5_step_input_border_style_hover); | ||
box-shadow: var(--_ui5-input-hover-box-shadow); | ||
} | ||
|
||
:host([value-state=Success]:not([readonly]):not([disabled]))::after, | ||
:host([value-state=Error]:not([readonly]):not([disabled]))::after, | ||
:host([value-state=None]:not([readonly]):not([disabled]))::after, | ||
:host([value-state=Information]:not([readonly]):not([disabled]))::after, | ||
:host([value-state=Warning]:not([readonly]):not([disabled]))::after { | ||
:host([value-state="Success"]:not([readonly]):not([disabled]):not([focused]):hover) { | ||
box-shadow: var(--_ui5-input-value-state-success-hover-box-shadow); | ||
} | ||
|
||
:host([value-state="Information"]:not([readonly]):not([disabled]):not([focused]):hover) { | ||
box-shadow: var(--_ui5-input-value-state-information-hover-box-shadow); | ||
} | ||
|
||
:host([value-state="Warning"]:not([readonly]):not([disabled]):not([focused]):hover) { | ||
box-shadow: var(--_ui5-input-value-state-warning-hover-box-shadow); | ||
} | ||
|
||
:host([value-state="Error"]:not([readonly]):not([disabled]):not([focused]):hover) { | ||
box-shadow: var(--_ui5-input-value-state-error-hover-box-shadow); | ||
} | ||
|
||
:host([value-state="Success"]:not([readonly]):not([disabled]):hover), | ||
:host([value-state="Error"]:not([readonly]):not([disabled]):hover), | ||
:host([value-state="Information"]:not([readonly]):not([disabled]):hover), | ||
:host([value-state="Warning"]:not([readonly]):not([disabled]):hover) { | ||
background-color: var(--_ui5-step_input_button_state_hover_background_color); | ||
} | ||
|
||
:host(:not([value-state]):not([readonly]):not([disabled])[focused]), | ||
:host([value-state="None"]:not([readonly]):not([disabled])[focused]), | ||
:host([value-state="Success"]:not([readonly]):not([disabled])[focused]), | ||
:host([value-state="Error"]:not([readonly]):not([disabled])[focused]), | ||
:host([value-state="Information"]:not([readonly]):not([disabled])[focused]), | ||
:host([value-state="Warning"]:not([readonly]):not([disabled])[focused]){ | ||
background-color: var(--sapField_Focus_Background); | ||
} | ||
|
||
:host([value-state="Success"]:not([readonly]):not([disabled]))::after, | ||
:host([value-state="Error"]:not([readonly]):not([disabled]))::after, | ||
:host([value-state="None"]:not([readonly]):not([disabled]))::after, | ||
:host([value-state="Information"]:not([readonly]):not([disabled]))::after, | ||
:host([value-state="Warning"]:not([readonly]):not([disabled]))::after { | ||
position: absolute; | ||
content: ""; | ||
top: -1px; | ||
|
@@ -45,34 +102,33 @@ | |
border-width: 0px; | ||
} | ||
|
||
:host([value-state=Information]:not([readonly]):not([disabled]))::after { | ||
:host([value-state="Information"]:not([readonly]):not([disabled]))::after { | ||
border-color: var(--sapField_InformationColor); | ||
border-width: var(--_ui5-input-information_border_width); | ||
} | ||
|
||
:host([value-state=Warning]:not([readonly]):not([disabled]))::after { | ||
:host([value-state="Warning"]:not([readonly]):not([disabled]))::after { | ||
border-color: var(--sapField_WarningColor); | ||
border-width: 2px; | ||
} | ||
|
||
:host([value-state=Success]:not([readonly]):not([disabled]))::after { | ||
:host([value-state="Success"]:not([readonly]):not([disabled]))::after { | ||
border-color: var(--sapField_SuccessColor); | ||
border-width: 1px; | ||
} | ||
|
||
:host([value-state=Error]:not([readonly]):not([disabled]))::after { | ||
:host([value-state="Error"]:not([readonly]):not([disabled]))::after { | ||
border-color: var(--sapField_InvalidColor); | ||
border-width: var(--_ui5-input-information_border_width); | ||
} | ||
|
||
:host([value-state])::after { | ||
border-width: var(--_ui5_input_state_border_width); | ||
border-width: var(--_ui5_input_state_border_width); | ||
} | ||
|
||
:host([value-state=Error]:not([readonly]):not([disabled])) .ui5-step-input-input { | ||
background-color: var(--sapField_InvalidBackground); | ||
:host([value-state="Error"]:not([readonly]):not([disabled])) .ui5-step-input-input:hover { | ||
background-color: var(--_ui5_step_input_input_error_background_color); | ||
} | ||
|
||
:host([value-state]:not([value-state="None"]) .ui5-step-input-input[focused]) { | ||
outline: none; | ||
} | ||
|
@@ -81,16 +137,25 @@ | |
width: 100%; | ||
color: inherit; | ||
background-color: inherit; | ||
border: 1px solid transparent; | ||
border: var(--_ui5_step_input_input_border); | ||
box-sizing: border-box; | ||
vertical-align: top; | ||
margin-top: -1px; | ||
margin-top: var(--_ui5_step_input_input_margin_top); | ||
min-width: 9.125rem; | ||
position: relative; | ||
padding: 0px 2.5rem 0px 2.4375rem; | ||
outline: none; | ||
} | ||
|
||
:host .ui5-step-input-input[readonly] { | ||
padding: 0; | ||
} | ||
|
||
:host .ui5-step-input-input:hover, | ||
:host .ui5-step-input-input[focused]{ | ||
box-shadow: none; | ||
} | ||
|
||
:host .ui5-step-input-root { | ||
white-space: nowrap; | ||
} | ||
|
@@ -109,10 +174,10 @@ | |
|
||
:host .ui5-step-icon { | ||
position: absolute; | ||
display: inline-block; | ||
display: var(--_ui5_step_input_button_display); | ||
height: 2rem; | ||
height: 100%; | ||
background-color: var(--sapField_Background); | ||
background-color: var(--_ui5_step_input_button_background_color); | ||
z-index: 2; | ||
} | ||
|
||
|
@@ -122,11 +187,11 @@ | |
} | ||
|
||
:host .ui5-step-icon.ui5-step-dec { | ||
left: 0; | ||
left: var(--_ui5_step_input_button_left); | ||
} | ||
|
||
:host .ui5-step-icon.ui5-step-inc { | ||
right: 0; | ||
right: var(--_ui5_step_input_button_right); | ||
} | ||
|
||
:host .ui5-step-icon *:not([clickable]), | ||
|
@@ -146,10 +211,11 @@ | |
:host .ui5-step-input-input[focused]::after { | ||
position: absolute; | ||
content: ""; | ||
border: var(--_ui5_input_focus_border_width) dotted var(--sapContent_FocusColor); | ||
top: 1px; | ||
border: var(--_ui5_step_input_input_border_focused_after); | ||
top: var(--_ui5_step_input_input_border_top_bottom_focused_after); | ||
right: 0px; | ||
bottom: 1px; | ||
bottom: var(--_ui5_step_input_input_border_top_bottom_focused_after); | ||
border-radius: var(--_ui5_step_input_input_border_radius_focused_after); | ||
left: 0px; | ||
outline: none; | ||
pointer-events: none; | ||
|
@@ -160,36 +226,27 @@ | |
outline: none; | ||
} | ||
|
||
:host([value-state]:not([value-state=None]):not([value-state=Success]):not([readonly]):not([disabled])) .ui5-step-input-input[focused]::after { | ||
top: 2px; | ||
right: 1px; | ||
bottom: 2px; | ||
left: 1px; | ||
:host([value-state="Information"]:not([readonly]):not([disabled])) .ui5-step-input-input[focused]::after { | ||
border-color: var(--_ui5_step_input_input_information_border_color_focused_after); | ||
} | ||
|
||
:host([value-state=Information]:not([readonly]):not([disabled]))::after { | ||
border-color: var(--sapField_InformationColor); | ||
border-width: var(--_ui5-input-information_border_width); | ||
:host([value-state="Warning"]:not([readonly]):not([disabled])) .ui5-step-input-input[focused]::after { | ||
border-color: var(--_ui5_step_input_input_warning_border_color_focused_after); | ||
} | ||
|
||
:host([value-state=Warning]:not([readonly]):not([disabled]))::after { | ||
border-color: var(--sapField_WarningColor); | ||
:host([value-state="Success"]:not([readonly]):not([disabled])) .ui5-step-input-input[focused]::after { | ||
border-color: var(--_ui5_step_input_input_success_border_color_focused_after); | ||
} | ||
|
||
:host([value-state=Success]:not([readonly]):not([disabled]))::after { | ||
border-color: var(--sapField_SuccessColor); | ||
border-width: 1px; | ||
} | ||
|
||
:host([value-state=Error]:not([readonly]):not([disabled]))::after { | ||
border-color: var(--sapField_InvalidColor); | ||
:host([value-state="Error"]:not([readonly]):not([disabled])) .ui5-step-input-input[focused]::after { | ||
border-color: var(--_ui5_step_input_input_error_border_color_focused_after); | ||
} | ||
|
||
/* Disable spin buttons in Chrome, Safari, Edge, Opera */ | ||
:host .ui5-step-input-input::-webkit-outer-spin-button, | ||
:host .ui5-step-input-input::-webkit-inner-spin-button { | ||
-webkit-appearance: none; | ||
margin: 0; | ||
-webkit-appearance: none; | ||
margin: 0; | ||
} | ||
|
||
:host([disabled]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the component is disabled, it should have opacity added over the regular state. Which means that we should have the same background image as in regular state and opacity on top There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
@@ -201,10 +258,9 @@ | |
} | ||
|
||
:host([disabled]) .ui5-step-icon { | ||
background: var(--sapField_ReadOnly_Background); | ||
background-color: var(--_ui5_step_input_disabled_button_background); | ||
} | ||
|
||
:host([disabled]) .ui5-step-icon [ui5-icon] { | ||
color: var(--sapField_ReadOnly_BorderColor); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
:root { | ||
--_ui5_step_input_input_error_background_color: var(--sapField_InvalidBackground); | ||
--_ui5-step_input_button_state_hover_background_color: var(--sapField_Background); | ||
--_ui5_step_input_border_style: 1px solid var(--sapField_BorderColor); | ||
--_ui5_step_input_border_style_hover: 1px solid var(--sapField_Hover_BorderColor); | ||
--_ui5_step_input_button_background_color:var(--sapField_Background); | ||
--_ui5_step_input_input_border: 1px solid transparent; | ||
--_ui5_step_input_input_margin_top: -0.0625rem; | ||
--_ui5_step_input_button_display: inline-block; | ||
--_ui5_step_input_button_left: 0; | ||
--_ui5_step_input_button_right: 0; | ||
--_ui5_step_input_input_border_focused_after: var(--_ui5_input_focus_border_width) dotted var(--sapContent_FocusColor); | ||
--_ui5_step_input_input_border_top_bottom_focused_after: 0.0625rem; | ||
--_ui5_step_input_input_border_radius_focused_after: 0; | ||
--_ui5_step_input_input_information_border_color_focused_after: var(--sapField_BorderColor); | ||
--_ui5_step_input_input_warning_border_color_focused_after: var(--sapField_BorderColor); | ||
--_ui5_step_input_input_success_border_color_focused_after: var(--sapField_BorderColor); | ||
--_ui5_step_input_input_error_border_color_focused_after: var(--sapField_BorderColor); | ||
--_ui5_step_input_disabled_button_background: var(--sapField_ReadOnly_Background); | ||
--_ui5_step_input_border_color_hover: var(--sapField_Hover_Background); | ||
--_ui5_step_input_border_hover: 1px solid var(--sapField_Hover_BorderColor); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In openUI5 when the increase/decrease button is active, there is a box-shadow and I think that it is the expected behaviour according to the requirement for the other inputs. Check the visualisation in openUI5 and make it the same here, when the button is active.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you hover over the increase/decrease button, the component box-shadow in not visible. When you hover over the buttons, it should be the same as you hover over the input field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done