Skip to content

Commit bc91704

Browse files
authored
Merge pull request #60 from zihanKuang/fix-image-class-name
fix(style): Rename image modal class to prevent style conflict
2 parents 1228c4a + 8447970 commit bc91704

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

assets/scss/_image-modal_project.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
}
55

66
/* The Modal (background) */
7-
.modal {
7+
.academy-image-modal {
88
display: none;
99
position: fixed;
1010
z-index: 9999999;
@@ -18,15 +18,15 @@
1818
}
1919

2020
/* Modal Content */
21-
.modal-cont {
21+
.academy-image-modal-cont {
2222
position: relative;
2323
margin: auto;
2424
padding: 0;
2525
width: 90%;
2626
max-width: 1400px;
2727
}
2828

29-
.modal-pic {
29+
.academy-image-modal-pic {
3030
display: flex;
3131
align-content: center;
3232
cursor: pointer;
@@ -35,7 +35,7 @@
3535
/* The Close Button */
3636
/* Optimized for accessibility by using a button named close but
3737
shifting the close text out of the button and only showing x */
38-
.modal-close {
38+
.academy-image-modal-close {
3939
color: white;
4040
background-color: transparent;
4141
position: absolute;
@@ -50,7 +50,7 @@
5050
z-index: 99;
5151
}
5252

53-
.modal-close::after {
53+
.academy-image-modal-close::after {
5454
position: absolute;
5555
line-height: 0.5;
5656
top: 0.2em;
@@ -59,8 +59,8 @@
5959
content: "\00D7"
6060
}
6161

62-
.modal-close:hover,
63-
.modal-close:focus {
62+
.academy-image-modal-close:hover,
63+
.academy-image-modal-close:focus {
6464
background-color: rgba(255, 255, 255, 0.1);
6565
text-decoration: none;
6666
cursor: pointer;

layouts/partials/image-modal.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<div id="myModal" class="modal">
2-
<button class="modal-close" onclick="closeModal()">close</button>
3-
<div class="modal-cont">
4-
<img class="modal-pic" id="modalPic" onclick="closeModal()" style="max-width: 100%; max-height: 80vh; margin: auto;" alt="Modal-pic">
1+
<div id="myModal" class="academy-image-modal">
2+
<button class="academy-image-modal-close" onclick="closeModal()">close</button>
3+
<div class="academy-image-modal-cont">
4+
<img class="academy-image-modal-pic" id="modalPic" onclick="closeModal()" style="max-width: 100%; max-height: 80vh; margin: auto;" alt="academy-image-modal-pic">
55
</div>
66
</div>
77

0 commit comments

Comments
 (0)