Skip to content

Commit aa70fd9

Browse files
authored
Merge pull request #29 from GetStream/develop
a11y and carousel updates
2 parents 7d73339 + 126925f commit aa70fd9

7 files changed

Lines changed: 239 additions & 12 deletions

File tree

src/styles/ChannelSearch.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
height: 40px;
5050
cursor: pointer;
5151
padding-left: 8px;
52+
width: 100%;
5253

5354
&:hover {
5455
font-weight: var(--font-weight-bold);

src/styles/MessageActions.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
font-size: var(--sm-font);
4343
color: var(--black);
4444
text-decoration: none;
45+
46+
&:focus {
47+
outline: 5px auto -webkit-focus-ring-color;
48+
}
4549
}
4650

4751
.str-chat__message-actions-list button:hover {

src/styles/MessageInput.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
.rfu-file-upload-button {
5757
right: 46px;
5858
top: calc(100% - 34px);
59+
60+
&:focus-within {
61+
outline: 5px auto -webkit-focus-ring-color;
62+
}
5963
}
6064

6165
&-footer {

src/styles/ModalImage.scss

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/styles/SendButton.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
border: 0;
44
background: 0;
55
outline: 0;
6+
7+
&:focus {
8+
outline: 5px auto -webkit-focus-ring-color;
9+
}
10+
611
@media screen and (min-width: 768px) {
712
display: none;
813
}

src/styles/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
@import './vendor/emoji-mart.scss'; // copy from '../../node_modules/emoji-mart/css/emoji-mart.css'
77
@import './vendor/mml-react.scss'; // copy from '../../node_modules/mml-react/dist/styles/index.css'
88
@import './vendor/react-file-utils.scss'; // copy from '../../node_modules/react-file-utils/dist/index.css'
9+
@import './vendor/react-image-gallery.scss'; // copy from '../../node_modules/react-image-gallery/styles/css/image-gallery.css'
910

1011
// Components
1112
@import './ActionsBox.scss';
@@ -38,7 +39,6 @@
3839
@import './MessageLivestream.scss';
3940
@import './MessageRepliesCountButton.scss';
4041
@import './Modal.scss';
41-
@import './ModalImage.scss';
4242
@import './ReactionList.scss';
4343
@import './ReactionSelector.scss';
4444
@import './SendButton.scss';
Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
$ig-small-screen: 768px !default;
2+
$ig-xsmall-screen: 480px !default;
3+
$ig-white: #fff !default;
4+
$ig-black: #000 !default;
5+
$ig-blue: #337ab7 !default;
6+
$ig-background-black: rgba(0, 0, 0, 0.4) !default;
7+
$ig-transparent: rgba(0, 0, 0, 0) !default;
8+
$ig-shadow: 0 2px 2px lighten($ig-black, 10%);
9+
10+
@mixin vendor-prefix($name, $value) {
11+
@each $vendor in ('-webkit-', '-moz-', '-ms-', '-o-', '') {
12+
#{$vendor}#{$name}: #{$value};
13+
}
14+
}
15+
16+
// SVG ICON STYLES
17+
.image-gallery-icon {
18+
color: $ig-white;
19+
transition: all 0.3s ease-out;
20+
appearance: none;
21+
background-color: transparent;
22+
border: 0;
23+
cursor: pointer;
24+
outline: none;
25+
position: absolute;
26+
z-index: 4;
27+
filter: drop-shadow($ig-shadow);
28+
29+
@media (hover: hover) and (pointer: fine) {
30+
&:hover {
31+
color: $ig-blue;
32+
.image-gallery-svg {
33+
transform: scale(1.1);
34+
}
35+
}
36+
}
37+
38+
&:focus {
39+
// a11y support
40+
outline: 2px solid $ig-blue;
41+
}
42+
}
43+
44+
.image-gallery-using-mouse {
45+
.image-gallery-icon {
46+
&:focus {
47+
outline: none;
48+
}
49+
}
50+
}
51+
52+
.image-gallery-fullscreen-button {
53+
bottom: 0;
54+
padding: 20px;
55+
56+
.image-gallery-svg {
57+
height: 28px;
58+
width: 28px;
59+
}
60+
61+
@media (max-width: $ig-small-screen) {
62+
padding: 15px;
63+
64+
.image-gallery-svg {
65+
height: 24px;
66+
width: 24px;
67+
}
68+
}
69+
70+
@media (max-width: $ig-xsmall-screen) {
71+
padding: 10px;
72+
73+
.image-gallery-svg {
74+
height: 16px;
75+
width: 16px;
76+
}
77+
}
78+
}
79+
80+
.image-gallery-fullscreen-button {
81+
right: 0;
82+
}
83+
84+
.image-gallery-left-nav,
85+
.image-gallery-right-nav {
86+
padding: 50px 10px;
87+
top: 50%;
88+
transform: translateY(-50%);
89+
90+
.image-gallery-svg {
91+
height: 120px;
92+
width: 60px;
93+
}
94+
95+
@media (max-width: $ig-small-screen) {
96+
.image-gallery-svg {
97+
height: 72px;
98+
width: 36px;
99+
}
100+
}
101+
102+
@media (max-width: $ig-xsmall-screen) {
103+
.image-gallery-svg {
104+
height: 48px;
105+
width: 24px;
106+
}
107+
}
108+
109+
&[disabled] {
110+
cursor: disabled;
111+
opacity: 0.6;
112+
pointer-events: none;
113+
}
114+
}
115+
116+
.image-gallery-left-nav {
117+
left: 0;
118+
}
119+
120+
.image-gallery-right-nav {
121+
right: 0;
122+
}
123+
// End of Icon styles
124+
125+
.image-gallery {
126+
@include vendor-prefix('user-select', none);
127+
-webkit-tap-highlight-color: $ig-transparent;
128+
position: relative;
129+
130+
&.fullscreen-modal {
131+
background: $ig-black;
132+
bottom: 0;
133+
height: 100%;
134+
left: 0;
135+
position: fixed;
136+
right: 0;
137+
top: 0;
138+
width: 100%;
139+
z-index: 5;
140+
141+
.image-gallery-content {
142+
top: 50%;
143+
transform: translateY(-50%);
144+
}
145+
}
146+
}
147+
148+
.image-gallery-content {
149+
position: relative;
150+
line-height: 0;
151+
top: 0;
152+
153+
&.fullscreen {
154+
background: $ig-black;
155+
}
156+
157+
.image-gallery-slide .image-gallery-image {
158+
max-height: calc(100vh - 80px); // 80 px for the thumbnail space
159+
}
160+
161+
&.left,
162+
&.right {
163+
.image-gallery-slide .image-gallery-image {
164+
max-height: 100vh;
165+
}
166+
}
167+
}
168+
169+
.image-gallery-slide-wrapper {
170+
position: relative;
171+
172+
&.left,
173+
&.right {
174+
display: inline-block;
175+
width: calc(100% - 110px); // 100px + 10px for margin
176+
177+
@media (max-width: $ig-small-screen) {
178+
width: calc(100% - 87px); // 81px + 6px for margin
179+
}
180+
}
181+
&.image-gallery-rtl {
182+
direction: rtl;
183+
}
184+
}
185+
186+
.image-gallery-slides {
187+
line-height: 0;
188+
overflow: hidden;
189+
position: relative;
190+
white-space: nowrap;
191+
text-align: center;
192+
}
193+
194+
.image-gallery-slide {
195+
left: 0;
196+
position: absolute;
197+
top: 0;
198+
width: 100%;
199+
200+
&.center {
201+
position: relative;
202+
}
203+
204+
.image-gallery-image {
205+
width: 100%;
206+
object-fit: contain;
207+
}
208+
}
209+
210+
.image-gallery-index {
211+
background: $ig-background-black;
212+
color: $ig-white;
213+
line-height: 1;
214+
padding: 10px 20px;
215+
position: absolute;
216+
right: 0;
217+
top: 0;
218+
z-index: 4;
219+
220+
@media (max-width: $ig-small-screen) {
221+
font-size: 0.8em;
222+
padding: 5px 10px;
223+
}
224+
}

0 commit comments

Comments
 (0)