Skip to content

Commit 49abea6

Browse files
Merge pull request #11 from Breeding-Insight/development
add css
2 parents 38672f4 + cbaf54c commit 49abea6

2 files changed

Lines changed: 71 additions & 15 deletions

File tree

R/app_ui.R

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,6 @@ app_ui <- function(request) {
144144
),
145145
dashboardBody(
146146
disconnectMessage(), #Adds generic error message for any error if not already accounted for
147-
tags$style(
148-
HTML(
149-
".main-footer {
150-
background-color: white;
151-
color: grey;
152-
height: 65px;
153-
padding-top: 5px;
154-
padding-bottom: 5px;
155-
}
156-
.main-footer a {
157-
color: grey;
158-
}"
159-
)
160-
),
161147
tabItems(
162148
tabItem(
163149
tabName = "welcome", mod_Home_ui("Home_1")
@@ -268,8 +254,27 @@ golem_add_external_resources <- function() {
268254
bundle_resources(
269255
path = app_sys("app/www"),
270256
app_title = "Breedverse"
271-
)
257+
),
272258
# Add here other external resources
273259
# for example, you can add shinyalert::useShinyalert()
260+
tags$style(HTML("
261+
/* Ensure box collapse/expand buttons are always on top */
262+
.card-tools { position: relative; z-index: 10; }
263+
/* Make collapse/expand icons visible on white box headers */
264+
.card-tools .btn-tool { color: #495057 !important; }
265+
.card-tools .btn-tool:hover { color: #212529 !important; }
266+
")),
267+
tags$script(HTML("
268+
$(document).ready(function() {
269+
// On page load: mirror active class from <li> onto <a> for CSS targeting
270+
$('#cnv_1-sample_select_tabs li.active > a').addClass('active');
271+
272+
// After each tab switch (content already swapped): sync active on <a> only
273+
$(document).on('shown.bs.tab', '#cnv_1-sample_select_tabs a[data-toggle=\"tab\"]', function(e) {
274+
$('#cnv_1-sample_select_tabs a[data-toggle=\"tab\"]').removeClass('active');
275+
$(e.target).addClass('active');
276+
});
277+
});
278+
"))
274279
)
275280
}

inst/app/www/custom.css

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* ── Select Samples tabsetPanel (By Sample / By Family) */
2+
3+
/* inactive tab - grey background */
4+
#cnv_1-sample_select_tabs > li > a:not(.active) {
5+
padding: 7px 22px !important;
6+
margin-right: 6px !important;
7+
background-color: #e9ecef !important;
8+
border: 1px solid #dee2e6 !important;
9+
border-bottom: none !important;
10+
border-radius: 4px 4px 0 0 !important;
11+
font-weight: 500 !important;
12+
color: #495057 !important;
13+
}
14+
15+
/* active tab */
16+
#cnv_1-sample_select_tabs > li > a.active {
17+
padding: 7px 22px !important;
18+
margin-right: 6px !important;
19+
background-color: #ffffff !important;
20+
border: 1px solid #dee2e6 !important;
21+
border-bottom: 1px solid #ffffff !important;
22+
border-radius: 4px 4px 0 0 !important;
23+
font-weight: 600 !important;
24+
color: #007bff !important;
25+
}
26+
27+
/* hover on inactive tab */
28+
#cnv_1-sample_select_tabs > li > a:not(.active):hover {
29+
background-color: #d6d8db !important;
30+
color: #343a40 !important;
31+
}
32+
33+
/* ── Ensure box collapse/expand buttons are always visible ── */
34+
.card-tools {
35+
position: relative;
36+
z-index: 10;
37+
color: black;
38+
}
39+
40+
/* ── Dashboard footer ── */
41+
.main-footer {
42+
background-color: white;
43+
color: grey;
44+
height: 65px;
45+
padding-top: 5px;
46+
padding-bottom: 5px;
47+
}
48+
49+
.main-footer a {
50+
color: grey;
51+
}

0 commit comments

Comments
 (0)