woocommerce/packages/js/components/src/list/style.scss

160 lines
2.8 KiB
SCSS
Raw Normal View History

.woocommerce-list {
margin: 0;
padding: 0;
}
Refactor <List> to support custom markup (https://github.com/woocommerce/woocommerce-admin/pull/6787) * Create the new experimental list, default to rendering it when items are not supplied. * Remove typings from the List, ListItem. * Add react-transition-group as dependency. * Fix warnings by wrapping with CSS transition, pass down props from List. * Remove type annotations left in list-item. * Duplicate some styles in the higher level woocommerce-list-item element, to make them work in the new list. * Fix accessibility issues, adjust the role logic * Add more testing of the roles logic. * Mark the old list stories as deprecated, add a basic story for the new style. * Expose ListItem without Experimental in the name. * Remove some redundant code changes. * Fix linting issues * Add types package. * Cast the type of children to TransitionGroup. * Adjust the list to assume a purpose of being a list of links. * Adjust the tests for the new behaviour. * Fix css mangled by prettier. * Fix types that are optional. * Rework the list item. * Export new list as experimental, fix accessibility styles and deprecation notice. * Make the basic transition opt-in. * Update classnames to get types. * Add tests, adjust behaviour for css disable. * Fix css lint, remove types/classnames, update tetsing-library/user-event. * Fix the basic story for ExperimentalList. * Conditionally add keyDown and role based on onClick handler. Adjust tests to new behaviour. * tabIndex only on hasAction * Update the package-lock * Add changelog * Fix transition styling Co-authored-by: Paul Sealock <psealock@gmail.com> Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2021-04-23 18:47:43 +00:00
a.woocommerce-list__item {
color: inherit;
}
.woocommerce-list__item {
display: flex;
align-items: center;
margin-bottom: 0;
Refactor <List> to support custom markup (https://github.com/woocommerce/woocommerce-admin/pull/6787) * Create the new experimental list, default to rendering it when items are not supplied. * Remove typings from the List, ListItem. * Add react-transition-group as dependency. * Fix warnings by wrapping with CSS transition, pass down props from List. * Remove type annotations left in list-item. * Duplicate some styles in the higher level woocommerce-list-item element, to make them work in the new list. * Fix accessibility issues, adjust the role logic * Add more testing of the roles logic. * Mark the old list stories as deprecated, add a basic story for the new style. * Expose ListItem without Experimental in the name. * Remove some redundant code changes. * Fix linting issues * Add types package. * Cast the type of children to TransitionGroup. * Adjust the list to assume a purpose of being a list of links. * Adjust the tests for the new behaviour. * Fix css mangled by prettier. * Fix types that are optional. * Rework the list item. * Export new list as experimental, fix accessibility styles and deprecation notice. * Make the basic transition opt-in. * Update classnames to get types. * Add tests, adjust behaviour for css disable. * Fix css lint, remove types/classnames, update tetsing-library/user-event. * Fix the basic story for ExperimentalList. * Conditionally add keyDown and role based on onClick handler. Adjust tests to new behaviour. * tabIndex only on hasAction * Update the package-lock * Add changelog * Fix transition styling Co-authored-by: Paul Sealock <psealock@gmail.com> Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2021-04-23 18:47:43 +00:00
text-decoration: none;
&.has-gutters {
padding: $gap $gap-large;
}
&.has-action {
cursor: pointer;
}
Refactor <List> to support custom markup (https://github.com/woocommerce/woocommerce-admin/pull/6787) * Create the new experimental list, default to rendering it when items are not supplied. * Remove typings from the List, ListItem. * Add react-transition-group as dependency. * Fix warnings by wrapping with CSS transition, pass down props from List. * Remove type annotations left in list-item. * Duplicate some styles in the higher level woocommerce-list-item element, to make them work in the new list. * Fix accessibility issues, adjust the role logic * Add more testing of the roles logic. * Mark the old list stories as deprecated, add a basic story for the new style. * Expose ListItem without Experimental in the name. * Remove some redundant code changes. * Fix linting issues * Add types package. * Cast the type of children to TransitionGroup. * Adjust the list to assume a purpose of being a list of links. * Adjust the tests for the new behaviour. * Fix css mangled by prettier. * Fix types that are optional. * Rework the list item. * Export new list as experimental, fix accessibility styles and deprecation notice. * Make the basic transition opt-in. * Update classnames to get types. * Add tests, adjust behaviour for css disable. * Fix css lint, remove types/classnames, update tetsing-library/user-event. * Fix the basic story for ExperimentalList. * Conditionally add keyDown and role based on onClick handler. Adjust tests to new behaviour. * tabIndex only on hasAction * Update the package-lock * Add changelog * Fix transition styling Co-authored-by: Paul Sealock <psealock@gmail.com> Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2021-04-23 18:47:43 +00:00
&:focus {
box-shadow: inset 0 0 0 1px $studio-wordpress-blue,
inset 0 0 0 2px $studio-white;
}
&:focus-visible {
box-shadow: none;
}
// transitions
&:not(.transitions-disabled) {
&.woocommerce-list__item-enter {
opacity: 0;
max-height: 0;
transform: translateX(50%);
}
&.woocommerce-list__item-enter-active {
opacity: 1;
max-height: 100vh;
transform: translateX(0%);
transition: opacity 500ms, transform 500ms, max-height 500ms;
}
&.woocommerce-list__item-exit {
opacity: 1;
max-height: 100vh;
transform: translateX(0%);
}
&.woocommerce-list__item-exit-active {
opacity: 0;
max-height: 0;
transform: translateX(50%);
transition: opacity 500ms, transform 500ms, max-height 500ms;
}
}
> .woocommerce-list__item-inner {
text-decoration: none;
width: 100%;
display: flex;
align-items: center;
padding: $gap $gap-large;
&:focus {
box-shadow: inset 0 0 0 1px $studio-wordpress-blue,
inset 0 0 0 2px $studio-white;
}
}
.woocommerce-list__item-title {
color: $studio-gray-90;
}
.woocommerce-list__item-content {
margin-top: $gap-smallest;
display: block;
font-size: 14px;
line-height: 20px;
color: #50575d;
}
.woocommerce-list__item-before {
margin-right: 20px;
display: flex;
align-items: center;
}
.woocommerce-list__item-after {
margin-left: $gap;
display: flex;
align-items: center;
margin-left: auto;
}
$chevron-color: $gray-900;
$background-color: $white;
$background-color-hover: $gray-100;
$border-color: $gray-100;
$foreground-color: var(--wp-admin-theme-color);
$foreground-color-hover: var(--wp-admin-theme-color);
background-color: $background-color;
&:not(:first-child) {
border-top: 1px solid $border-color;
}
&:hover {
background-color: $background-color-hover;
.woocommerce-list__item-title {
color: $foreground-color-hover;
}
.woocommerce-list__item-before > svg {
fill: $foreground-color-hover;
}
}
.woocommerce-list__item-title,
.woocommerce-list__item-title > div {
color: $foreground-color;
}
.woocommerce-list__item-before > svg {
fill: $foreground-color;
}
.woocommerce-list__item-after > svg {
fill: $chevron-color;
}
&.is-complete {
.woocommerce-task__icon {
background-color: var(--wp-admin-theme-color);
}
.woocommerce-list__item-title {
color: $gray-700;
}
.woocommerce-list__item-content {
display: none;
}
}
}
.woocommerce-list__item-title {
color: $studio-gray-80;
}
.woocommerce-list__item-content {
color: $studio-gray-50;
}