woocommerce/packages/js/customer-effort-score/src/style.scss

103 lines
1.7 KiB
SCSS
Raw Normal View History

Update Customer Effort Score Modal (https://github.com/woocommerce/woocommerce-admin/pull/5515) * Add Customer Effort Score modal * Add style for selected emoji * Update modal layout to match design * Update colors to use color studio variables * Refactor SCSS to reduce nesting * Refactor render logic to reduce nesting * Add translation to strings * Add keyboard support to emoji buttons * Fix button misalignment * Fix missing white space around button text * Refactor emoji button layout with flexbox Flexbox makes more sense to use than a grid since the buttons need only a single row or column layout. * Refactor merge conflict resolution Tidies up the diff by - Using naming convention of “visible” instead of “open”. - Restoring previous import order. * Add comments field * Update initial score value to undefined * Refactor SASS selectors * Update sendScore with comments data * Fix comments field to display on low scores only * Refactor by extracting modal to own component * Add input validation * Add tests * Fix variable name * Update Feedback component documentation * Fix uneven button height * Restore previous prop names This ensures naming consistency with the CustomerEffortScore component. * Update variable name for consistency * Don't close modal if click outside it * Rename Feedback component to CustomerFeedbackModal * Update error message text * Fix import name * Fix formatting * Update test to use mockRecordScoreCallback prop name * Convert score to int before recording * Clear error message when score has been selected * Add transitions when comments field is shown/hidden * Wrapped comments field UI text for localization * Increase contrast ratio for focused effort score labels Co-authored-by: Matt Sherman <matt@jam123.com> Co-authored-by: Rebecca Scott <me@becdetat.com>
2020-11-25 02:34:54 +00:00
.woocommerce-customer-effort-score__selection {
margin: 1em 0;
.components-base-control__field {
display: flex;
flex-direction: column;
margin: 0 auto;
color: var(--wp-admin-theme-color);
@include breakpoint( '>600px' ) {
flex-direction: row;
}
}
.components-radio-control__option {
&:not(:last-child) {
// Override package component style.
margin-bottom: 0;
margin-right: 4px;
Update Customer Effort Score Modal (https://github.com/woocommerce/woocommerce-admin/pull/5515) * Add Customer Effort Score modal * Add style for selected emoji * Update modal layout to match design * Update colors to use color studio variables * Refactor SCSS to reduce nesting * Refactor render logic to reduce nesting * Add translation to strings * Add keyboard support to emoji buttons * Fix button misalignment * Fix missing white space around button text * Refactor emoji button layout with flexbox Flexbox makes more sense to use than a grid since the buttons need only a single row or column layout. * Refactor merge conflict resolution Tidies up the diff by - Using naming convention of “visible” instead of “open”. - Restoring previous import order. * Add comments field * Update initial score value to undefined * Refactor SASS selectors * Update sendScore with comments data * Fix comments field to display on low scores only * Refactor by extracting modal to own component * Add input validation * Add tests * Fix variable name * Update Feedback component documentation * Fix uneven button height * Restore previous prop names This ensures naming consistency with the CustomerEffortScore component. * Update variable name for consistency * Don't close modal if click outside it * Rename Feedback component to CustomerFeedbackModal * Update error message text * Fix import name * Fix formatting * Update test to use mockRecordScoreCallback prop name * Convert score to int before recording * Clear error message when score has been selected * Add transitions when comments field is shown/hidden * Wrapped comments field UI text for localization * Increase contrast ratio for focused effort score labels Co-authored-by: Matt Sherman <matt@jam123.com> Co-authored-by: Rebecca Scott <me@becdetat.com>
2020-11-25 02:34:54 +00:00
}
input {
// Hide the radio input but keep it accessibile.
position: absolute;
opacity: 0;
}
label {
display: block;
text-align: center;
box-sizing: border-box;
width: 9em;
height: 100%;
padding: 1em 0.5em;
font-size: 0.9em;
&:hover {
background-color: $studio-wordpress-blue-0;
}
}
input:focus + label {
outline: 2px solid $studio-wordpress-blue;
background-color: peach;
color: $studio-blue-60;
}
input:checked + label {
outline: 2px solid $studio-wordpress-blue;
Update Customer Effort Score Modal (https://github.com/woocommerce/woocommerce-admin/pull/5515) * Add Customer Effort Score modal * Add style for selected emoji * Update modal layout to match design * Update colors to use color studio variables * Refactor SCSS to reduce nesting * Refactor render logic to reduce nesting * Add translation to strings * Add keyboard support to emoji buttons * Fix button misalignment * Fix missing white space around button text * Refactor emoji button layout with flexbox Flexbox makes more sense to use than a grid since the buttons need only a single row or column layout. * Refactor merge conflict resolution Tidies up the diff by - Using naming convention of “visible” instead of “open”. - Restoring previous import order. * Add comments field * Update initial score value to undefined * Refactor SASS selectors * Update sendScore with comments data * Fix comments field to display on low scores only * Refactor by extracting modal to own component * Add input validation * Add tests * Fix variable name * Update Feedback component documentation * Fix uneven button height * Restore previous prop names This ensures naming consistency with the CustomerEffortScore component. * Update variable name for consistency * Don't close modal if click outside it * Rename Feedback component to CustomerFeedbackModal * Update error message text * Fix import name * Fix formatting * Update test to use mockRecordScoreCallback prop name * Convert score to int before recording * Clear error message when score has been selected * Add transitions when comments field is shown/hidden * Wrapped comments field UI text for localization * Increase contrast ratio for focused effort score labels Co-authored-by: Matt Sherman <matt@jam123.com> Co-authored-by: Rebecca Scott <me@becdetat.com>
2020-11-25 02:34:54 +00:00
background-color: $studio-wordpress-blue-0;
}
// Replace the hidden radio input with emoji.
label::before {
display: block;
font-size: 24px;
text-align: center;
margin: 1em 0;
color: $studio-wordpress-blue;
}
input[value='1'] + label::before {
content: '😞';
}
input[value='2'] + label::before {
content: '🙁';
}
input[value='3'] + label::before {
content: '😐';
}
input[value='4'] + label::before {
content: '🙂';
}
input[value='5'] + label::before {
content: '😁';
}
}
}
.woocommerce-customer-effort-score__comments {
label {
display: block;
color: inherit;
font-weight: bold;
}
textarea {
width: 100%;
}
}
.woocommerce-customer-effort-score__buttons {
text-align: right;
.components-button {
margin-left: 1em;
}
}