Skip to content

Commit 2005d33

Browse files
committed
Added CSS variables for better customization. Fixes #8
1 parent 5255345 commit 2005d33

File tree

7 files changed

+44
-19
lines changed

7 files changed

+44
-19
lines changed

components/alt-bits-carrousel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ BitsCarrouselTemplate.innerHTML = `
44
:host{
55
display: inline-flex;
66
align-items: center;
7-
column-gap: 1em;
7+
column-gap: var(--bits-carrousel_column-gap);
88
}
99
:host>*:hover{
10-
transform: scale(1.04)
10+
transform: var(--bits-carrousel_circle-hover-transform);
1111
}
1212
</style>
1313
`;

components/alt-bits-circle.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ BitsCircleTemplate.innerHTML = `
88
align-items: center;
99
}
1010
:host .circle{
11-
background: black;
12-
color: white;
11+
background: var(--bits-circle_background);
12+
color: var(--bits-circle_color);
1313
border-radius: 100%;
1414
display: flex;
1515
align-items: center;
1616
justify-content: center;
1717
}
1818
:host .badge{
19-
width: 200px;
19+
width: var(--bits-circle_badge-width);
2020
padding: 4px;
21-
font-weight: 600;
22-
font-size: 1.1rem;
21+
font-weight: var(--bits-circle_badge-weight);
22+
font-size: var(--bits-circle_badge-font-size);
2323
text-align: center;
2424
}
2525
:host .badge:empty{

components/alt-bits-participant-detail.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ BitsParticipantDetailTemplate.innerHTML = `
33
<style>
44
:host{
55
padding: 16px;
6-
background: rgba(255,255,255,0.9);
6+
background: var(--bits-participation-detail_background);
77
display: block;
88
position: relative;
99
}
1010
:host alt-bits-participation:hover{
1111
border-radius: 8px;
12-
background: whitesmoke;
12+
background: var(--bits-participation-detail_participation-background-hover);
1313
}
1414
</style>
1515
<header>

components/alt-bits-participant.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ BitsParticipantTemplate.innerHTML = `
3434
height: 32px;
3535
width: 32px;
3636
border-radius: 16px;
37-
background: black;
38-
color: white;
37+
background: var(--bits-participant_score-background);
38+
color: var(--bits-participant_score-color);
3939
font-size: 0.8rem;
4040
line-height: 32px;
4141
text-align: center;

components/alt-bits-participation.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ BitsParticipationTemplate.innerHTML = `
2222
:host .participation-category{
2323
font-size: 1rem;
2424
font-weight: 600;
25-
background-color: grey;
25+
background-color: var(--bits-participation_badge-background);
2626
padding: 2px 8px;
2727
border-radius: 16px;
28-
color: white;
28+
color: var(--bits-participation_badge-color);
2929
margin-left: -2px
3030
}
3131
:host .participation-date{
@@ -40,8 +40,8 @@ BitsParticipationTemplate.innerHTML = `
4040
height: 32px;
4141
width: 32px;
4242
border-radius: 16px;
43-
background-color: black;
44-
color: white;
43+
background-color: var(--bits-participation_score-background);
44+
color: var(--bits-participation_score-color);
4545
line-height: 32px;
4646
text-align: center;
4747
}

components/ui-modal.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ ModalWindowTemplate.innerHTML = `
44
:host>div{
55
position: fixed;
66
top: 0; bottom: 0; left: 0; right: 0;
7-
background-color: rgba(240,240,240,0.6);
8-
backdrop-filter: blur(16px);
7+
background-color: var(--ui-modal_background);
8+
backdrop-filter: var(--ui-modal_backdrop-filter);
99
display: flex;
1010
align-items: center;
1111
justify-content: center;
1212
padding: 8px
1313
}
1414
:host modal{
1515
margin-top: 8px;
16-
max-width: 600px;
16+
max-width: var(--ui-modal_max-width);
1717
width: 100%;
18-
max-height: 90vh;
18+
max-height: var(--ui-modal_max-height);
1919
overflow: auto
2020
}
2121
</style>

style.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
:root{
2+
--bits-carrousel_circle-hover-transform: scale(1.05);
3+
--bits-carrousel_column-gap: 1em;
4+
5+
--bits-circle_background: black;
6+
--bits-circle_color: white;
7+
--bits-circle_badge-width: 200px;
8+
--bits-circle_badge-weight: 600;
9+
--bits-circle_badge-font-size: 1.1rem;
10+
11+
--bits-participation-detail_background: rgba(255,255,255,0.8);
12+
--bits-participation-detail_participation-background-hover: whitesmoke;
13+
14+
--bits-participant_score-background: black;
15+
--bits-participant_score-color: white;
16+
17+
--bits-participation_badge-background: grey;
18+
--bits-participation_badge-color: white;
19+
20+
--bits-participation_score-background: black;
21+
--bits-participation_score-color: white;
22+
23+
--ui-modal_background: rgba(240,240,240,0.6);
24+
--ui-modal_backdrop-filter: blur(16px);
25+
--ui-modal_max-width: 600px;
26+
--ui-modal_max-height: 90vh;
227

328
}
429
body{

0 commit comments

Comments
 (0)