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

132 lines
2.3 KiB
SCSS
Raw Normal View History

@import 'components/customer-feedback-simple/customer-feedback-simple.scss';
@import 'components/feedback-modal/feedback-modal.scss';
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 1.5em 0;
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
.components-base-control__field {
display: flex;
flex-direction: column;
margin: 0 auto;
color: var(--wp-admin-theme-color);
@include breakpoint( '>600px' ) {
flex-direction: row;
justify-content: center;
}
.components-h-stack {
@include breakpoint( '>600px' ) {
flex-direction: row;
}
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
}
}
.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 {
2022-05-16 13:27:35 +00:00
content: '😑';
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[value='4'] + label::before {
content: '🙂';
}
input[value='5'] + label::before {
2022-05-16 13:27:35 +00:00
content: '😍';
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__comments {
margin-bottom: 1.5em;
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
label {
display: block;
color: inherit;
font-weight: bold;
text-transform: none;
font-size: 14px;
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
}
textarea {
width: 100%;
}
}
[MVP QA #1] Visual: spacings (#38325) * Update the margin-left on the buttons in the top bar from 16px to 8px * On mobile, the left and right body margins should be 32 px * The inner padding in the tab in the top bar should be 12px, not 16px * In the edit product link modal, let's set this modal’s width to 650 px and remove the line separating the header from the contents * All modals should now have 8 px window radius * In the feedback form, can we fix the buttons at the bottom * The help icon in checkboxes small, detached from the item label, and vertically misaligned. Left margin of 4 px, no vertical adjustment; somehow it has a -2px set for the top margin) * Fix block-editor-block-contextual-toolbar top position * When the product is in a draft state, the button in the top bar should say Add, not Save. It should change into Update once it's published on the store * Fix layout margin top * Add ection support for blockGap and set title and description to optional * Remove non needed control field margin bottom * Fix schedule sale block spacing * Remove non needed control field help text margin bottom * Remove the sub section outer spacing * Move pricing fields into a sub section block * Fix collapsible-contet margin top * Remove invalid inner block layout spacing * Wrap sku, stock toogle and quantity within a sub section * Group inventory advance section inner blocks into a sub section * Fix linter error * Add changelog files * Fix php lint error * Change unit names to fit GB definitions see: https://github.com/WordPress/gutenberg/blob/b2c16f3c684098a8dabff3911c610caa5c053701/packages/base-styles/_variables.scss\#L31-L41
2023-06-01 17:56:31 +00:00
.components-modal__content {
padding-bottom: 100px;
}
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__buttons {
text-align: right;
[MVP QA #1] Visual: spacings (#38325) * Update the margin-left on the buttons in the top bar from 16px to 8px * On mobile, the left and right body margins should be 32 px * The inner padding in the tab in the top bar should be 12px, not 16px * In the edit product link modal, let's set this modal’s width to 650 px and remove the line separating the header from the contents * All modals should now have 8 px window radius * In the feedback form, can we fix the buttons at the bottom * The help icon in checkboxes small, detached from the item label, and vertically misaligned. Left margin of 4 px, no vertical adjustment; somehow it has a -2px set for the top margin) * Fix block-editor-block-contextual-toolbar top position * When the product is in a draft state, the button in the top bar should say Add, not Save. It should change into Update once it's published on the store * Fix layout margin top * Add ection support for blockGap and set title and description to optional * Remove non needed control field margin bottom * Fix schedule sale block spacing * Remove non needed control field help text margin bottom * Remove the sub section outer spacing * Move pricing fields into a sub section block * Fix collapsible-contet margin top * Remove invalid inner block layout spacing * Wrap sku, stock toogle and quantity within a sub section * Group inventory advance section inner blocks into a sub section * Fix linter error * Add changelog files * Fix php lint error * Change unit names to fit GB definitions see: https://github.com/WordPress/gutenberg/blob/b2c16f3c684098a8dabff3911c610caa5c053701/packages/base-styles/_variables.scss\#L31-L41
2023-06-01 17:56:31 +00:00
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: #fff;
padding: calc( 2 * $gap );
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
.components-button {
margin-left: 1em;
}
}
.woocommerce-customer-effort-score .woocommerce-customer-effort-score__intro {
max-width: 550px;
margin: 0 0 1.5em 0;
}