woocommerce/plugins/woocommerce-admin/client/header/activity-panel/style.scss

265 lines
4.9 KiB
SCSS
Raw Normal View History

.woocommerce-layout__activity-panel {
display: flex;
flex-direction: row;
align-items: center;
position: fixed;
right: 0;
Add WooCommerce Mobile App Banner Ad for Android and iOS (https://github.com/woocommerce/woocommerce-admin/pull/5037) Fixes woocommerce/woocommerce-admin#4654 The feature calls for a mobile app ad banner to be displayed to users on mobile devices. Based on the discussion in woocommerce/woocommerce-admin#4654 this implements the following: 1. [an iOS Smart App Banner](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html). This banner is a meta tag that is generated in PHP. It will only display on iOS devices. One note about this: **This tag is not directly trackable like the implemented Android banner. If we would like to track its success then I believe [these instructions are relevant](https://stackoverflow.com/questions/12906502/is-it-possible-to-track-click-throughs-from-iphone-smart-banner/20422334woocommerce/woocommerce-admin#20422334)**. 2. A mobile app banner ad that **only displays on Android** and only displays at the `738px` breakpoint specified in the issue. To only display this banner ad on Android, we use basic checking of the user agent string. I weighed this up against other approaches and for this kind of niche use case a simple UA string check is (imho) still the best way to do this. 3. The banner ad makes use of user preferences to retain a per user setting that determines if that user has dismissed the Android banner. We don't/can't do anything like this for the iOS Smart App Banner (but in theory we shouldn't need to).
2020-08-27 01:46:53 +00:00
top: 32px;
height: $header-height;
@include breakpoint( '<782px' ) {
position: relative;
background: $studio-white;
margin: 0;
padding: 0;
width: 100vw;
display: none;
flex: 1 100%;
}
@include breakpoint( '782px-960px' ) {
max-width: 280px;
}
@include breakpoint( '>1280px' ) {
max-width: 400px;
}
&.is-mobile-open {
display: flex;
}
}
.woocommerce-layout__activity-panel-tabs {
width: 100%;
display: flex;
height: $header-height;
justify-content: flex-end;
.dashicon,
.gridicon {
width: 100%;
}
svg {
width: 18px;
height: 18px;
// custom progress icon, requires specific coloring
&.setup-progress {
fill: none;
path:last-child {
stroke: currentColor;
}
}
@include breakpoint( '>960px' ) {
width: 24px;
height: 24px;
}
}
.components-icon-button {
display: initial;
text-indent: 0;
border-radius: 0;
&.has-text {
svg {
margin: 0;
}
}
}
.woocommerce-layout__activity-panel-tab {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
border: none;
outline: none;
cursor: pointer;
background-color: $studio-white;
max-width: min-content;
min-width: 80px;
width: 100%;
height: $header-height;
color: $gray-700;
white-space: nowrap;
&::before {
background-color: var(--wp-admin-theme-color);
bottom: 0;
content: '';
height: 0;
opacity: 0;
transition-property: height, opacity;
transition-duration: 300ms;
transition-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
left: 0;
position: absolute;
right: 0;
}
&.is-active {
color: $gray-900;
box-shadow: none;
&::before {
height: 3px;
opacity: 1;
}
}
&.has-unread::after,
&.woocommerce-layout__activity-panel-tab-wordpress-notices::after {
content: ' ';
position: absolute;
padding: 1px;
background: $alert-red;
border: 2px solid $studio-white;
width: 4px;
height: 4px;
display: inline-block;
border-radius: 50%;
top: 8px;
left: 50%;
@include breakpoint( '782px-960px' ) {
right: 18px;
left: initial;
margin-left: 0;
}
@include breakpoint( '>960px' ) {
right: 28px;
left: initial;
margin-left: 0;
}
}
&:hover,
&.components-button:not(:disabled):not([aria-disabled='true']):hover {
background-color: $gray-100;
box-shadow: none;
&.has-unread::after,
&.woocommerce-layout__activity-panel-tab-wordpress-notices::after {
border-color: $gray-200;
}
}
&:focus,
&.components-button:not(:disabled):not([aria-disabled='true']):focus {
box-shadow: inset -1px -1px 0 $gray-700, inset 1px 1px 0 $gray-700;
}
}
}
.woocommerce-layout__activity-panel-mobile-toggle {
margin-right: 10px;
max-width: 48px;
height: $header-height;
Add WooCommerce Mobile App Banner Ad for Android and iOS (https://github.com/woocommerce/woocommerce-admin/pull/5037) Fixes woocommerce/woocommerce-admin#4654 The feature calls for a mobile app ad banner to be displayed to users on mobile devices. Based on the discussion in woocommerce/woocommerce-admin#4654 this implements the following: 1. [an iOS Smart App Banner](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html). This banner is a meta tag that is generated in PHP. It will only display on iOS devices. One note about this: **This tag is not directly trackable like the implemented Android banner. If we would like to track its success then I believe [these instructions are relevant](https://stackoverflow.com/questions/12906502/is-it-possible-to-track-click-throughs-from-iphone-smart-banner/20422334woocommerce/woocommerce-admin#20422334)**. 2. A mobile app banner ad that **only displays on Android** and only displays at the `738px` breakpoint specified in the issue. To only display this banner ad on Android, we use basic checking of the user agent string. I weighed this up against other approaches and for this kind of niche use case a simple UA string check is (imho) still the best way to do this. 3. The banner ad makes use of user preferences to retain a per user setting that determines if that user has dismissed the Android banner. We don't/can't do anything like this for the iOS Smart App Banner (but in theory we shouldn't need to).
2020-08-27 01:46:53 +00:00
position: absolute;
right: 0;
Add WooCommerce Mobile App Banner Ad for Android and iOS (https://github.com/woocommerce/woocommerce-admin/pull/5037) Fixes woocommerce/woocommerce-admin#4654 The feature calls for a mobile app ad banner to be displayed to users on mobile devices. Based on the discussion in woocommerce/woocommerce-admin#4654 this implements the following: 1. [an iOS Smart App Banner](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html). This banner is a meta tag that is generated in PHP. It will only display on iOS devices. One note about this: **This tag is not directly trackable like the implemented Android banner. If we would like to track its success then I believe [these instructions are relevant](https://stackoverflow.com/questions/12906502/is-it-possible-to-track-click-throughs-from-iphone-smart-banner/20422334woocommerce/woocommerce-admin#20422334)**. 2. A mobile app banner ad that **only displays on Android** and only displays at the `738px` breakpoint specified in the issue. To only display this banner ad on Android, we use basic checking of the user agent string. I weighed this up against other approaches and for this kind of niche use case a simple UA string check is (imho) still the best way to do this. 3. The banner ad makes use of user preferences to retain a per user setting that determines if that user has dismissed the Android banner. We don't/can't do anything like this for the iOS Smart App Banner (but in theory we shouldn't need to).
2020-08-27 01:46:53 +00:00
bottom: 0;
@include breakpoint( '>782px' ) {
display: none;
}
}
.wp-responsive-open .woocommerce-layout__activity-panel-mobile-toggle {
display: none;
}
.woocommerce-layout__activity-panel-toggle-bubble.has-unread::after {
content: ' ';
position: absolute;
padding: 1px;
background: $core-orange;
border: 2px solid $studio-white;
width: 4px;
height: 4px;
display: inline-block;
border-radius: 50%;
top: 6px;
right: 4px;
}
@keyframes tabSwitch {
0%,
100% {
transform: translateX(0);
}
50% {
transform: translateX(100px);
}
}
@mixin activity-panel-slide {
transition-property: transform box-shadow;
transition-duration: 300ms;
transition-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
@media screen and ( prefers-reduced-motion: reduce ) {
transition-duration: 1ms;
}
}
.woocommerce-layout__activity-panel-wrapper {
height: calc(100vh - #{$header-height + $header-height + $adminbar-height-mobile});
background: $gray-100;
width: 510px;
@include breakpoint( '<782px' ) {
width: 100%;
}
transform: translateX(100%);
@include activity-panel-slide();
position: fixed;
right: 0;
top: #{$header-height + $header-height + $adminbar-height-mobile};
z-index: 1000;
overflow-x: hidden;
overflow-y: auto;
@include breakpoint( '>782px' ) {
height: calc(100vh - #{$header-height + $adminbar-height});
top: #{$header-height + $adminbar-height};
}
&.is-open {
transform: initial;
box-shadow: 0 12px 12px 0 rgba(85, 93, 102, 0.3);
}
&.is-switching {
animation: tabSwitch;
animation-duration: 300ms;
@media screen and ( prefers-reduced-motion: reduce ) {
animation: none;
}
}
.woocommerce-empty-content {
padding-left: $gap-large;
padding-right: $gap-large;
}
}
.woocommerce-layout__activity-panel-avatar-flag-overlay {
position: relative;
top: -$gap-small;
.woocommerce-flag {
position: relative;
top: 16px;
border: 2px solid $studio-white;
}
}
.woocommerce-layout__notice-list-hide {
display: none;
}