summaryrefslogtreecommitdiff
blob: 18073276605c3017601972e84e2ab78d0a04ec12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
@import '../../shared/styles/gutenberg-variables.scss';

.wp-block-jetpack-business-hours {
	overflow: hidden;

	.business-hours__row {
		display: flex;

		&.business-hours-row__add,
		&.business-hours-row__closed {
			margin-bottom: 20px;
		}

		.business-hours__day {
			width: 44%;
			display: flex;
			align-items: baseline;

			.business-hours__day-name {
				width: 60%;
				font-weight: bold;
				overflow-x: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}

			.components-form-toggle {
				margin-right: 4px;
			}
		}

		.business-hours__hours {
			width: 44%;
			margin: 0;
			display: flex;
			align-items: center;
			flex-wrap: wrap;

			.components-base-control {
				display: inline-block;
				margin-bottom: 0;
				width: 48%;

				&.business-hours__open {
					margin-right: 4%;
				}

				.components-base-control__label {
					margin-bottom: 0;
				}
			}
		}
	}

	.business-hours__remove {
		align-self: flex-end;
		margin-bottom: 8px;
		text-align: center;
		width: 10%;
	}

	.business-hours-row__add button:hover {
		box-shadow: none !important;
	}

	.business-hours__remove button {
		display: block;
		margin: 0 auto;
	}

	.business-hours-row__add .components-button.is-default:hover,
	.business-hours__remove .components-button.is-default:hover,
	.business-hours-row__add .components-button.is-default:focus,
	.business-hours__remove .components-button.is-default:focus,
	.business-hours-row__add .components-button.is-default:active,
	.business-hours__remove .components-button.is-default:active {
		background: none;
		box-shadow: none;
	}
}

/**
 * We consider the editor area to be small when the business hours block is:
 *   - within a column block
 *   - in a screen < xlarge size with the sidebar open
 *   - in a screen < small size
 * In these cases we'll apply small screen styles.
 */
@mixin editor-area-is-small {
	@media ( max-width: $break-xlarge ) {
		.is-sidebar-opened {
			@content;
		}
	}
	@media ( max-width: $break-small ) {
		@content;
	}

	.wp-block-columns {
		@content;
	}
}

@include editor-area-is-small() {
	.wp-block-jetpack-business-hours {
		.business-hours__row {
			flex-wrap: wrap;

			&.business-hours-row__add {
				.business-hours__day,
				.business-hours__remove {
					display: none;
				}
			}

			.business-hours__day {
				width: 100%;
			}

			.business-hours__hours {
				width: 78%;
			}
			.business-hours__remove {
				width: 18%;
			}
		}
	}
}