Skip to content

Commit

Permalink
variables badges: custom class for label
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Sep 23, 2022
1 parent 94f6fd8 commit 5861cfe
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 24 deletions.
10 changes: 5 additions & 5 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ badgeType <- function(col_name, col_type) {
col_name_i <- col_name[i]
col_type_i <- col_type[i]
if (col_type_i == "discrete") {
tags$span(class = "label label-discrete badge-dad", col_name_i)
tags$span(class = "label-esquisse label-discrete badge-dad", col_name_i)
} else if (col_type_i == "time") {
tags$span(class = "label label-datetime badge-dad", col_name_i)
tags$span(class = "label-esquisse label-datetime badge-dad", col_name_i)
} else if (col_type_i == "continuous") {
tags$span(class="label label-continuous badge-dad", col_name_i)
tags$span(class="label-esquisse label-continuous badge-dad", col_name_i)
} else if (col_type_i == "id") {
tags$span(class = "label label-default badge-dad", col_name_i)
tags$span(class = "label-esquisse label-default badge-dad", col_name_i)
} else {
tags$span(class = "label label-other badge-dad", col_name_i)
tags$span(class = "label-esquisse label-other badge-dad", col_name_i)
}
}
)
Expand Down
19 changes: 0 additions & 19 deletions inst/assets/dragula/styles-dad.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,6 @@
font-size: 120%;
}

.label-discrete {
background-color: #EF562D;
color: #FFFFFF;
}

.label-continuous {
background-color: #0C4C8A;
color: #FFFFFF;
}

.label-datetime {
background-color: #97D5E0;
color: #FFFFFF;
}

.label-other {
background-color: #2E2E2E;
color: #FFFFFF;
}

.badge-dad {
border-radius: 7px !important;
Expand Down
30 changes: 30 additions & 0 deletions inst/assets/esquisse/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,33 @@ div[id^="shiny-notification-esquisse"] > .shiny-notification-close {
}



/* Style for variable badges */
.label-esquisse {
display: inline;
padding: .2em .6em .3em;
font-size: 80%;
font-weight: 700;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
.label-discrete {
background-color: #EF562D;
color: #FFFFFF;
}
.label-continuous {
background-color: #0C4C8A;
color: #FFFFFF;
}
.label-datetime {
background-color: #97D5E0;
color: #FFFFFF;
}
.label-other {
background-color: #2E2E2E;
color: #FFFFFF;
}

0 comments on commit 5861cfe

Please sign in to comment.