1#' Deprecated functions
2#'
3#' These functions have been deprecated but remain for backwards compatibility.
4#'
5#' @keywords internal
6#' @rdname deprecated
7#' @returns a [bs_theme()] object.
8#' @export
9bs_theme_new <- function(...) {
10  .Deprecated("bs_global_theme")
11  bs_global_theme(...)
12}
13
14#' @rdname deprecated
15#' @export
16bs_theme_clear <- function(...) {
17  .Deprecated("bs_global_clear")
18  bs_global_clear(...)
19}
20
21#' @rdname deprecated
22#' @export
23bs_theme_get <- function(...) {
24  .Deprecated("bs_global_get")
25  bs_global_get(...)
26}
27
28#' @rdname deprecated
29#' @export
30bs_theme_set <- function(...) {
31  .Deprecated("bs_global_set")
32  bs_global_set(...)
33}
34
35#' @rdname deprecated
36#' @export
37bs_theme_base_colors <- function(...) {
38  .Deprecated("bs_global_base_colors")
39  bs_global_base_colors(...)
40}
41
42bs_global_base_colors <- function(bg = "#FFFFFF", fg = "#000000") {
43  theme <- assert_global_theme("bs_global_base_colors()")
44  theme <- bs_base_colors(theme, bg = bg, fg = fg)
45  bs_global_set(theme)
46}
47
48#' @rdname deprecated
49#' @export
50bs_theme_accent_colors <- function(...) {
51  .Deprecated("bs_global_accent_colors")
52  bs_global_accent_colors(...)
53}
54
55bs_global_accent_colors <- function(primary = NULL, secondary = NULL, success = NULL,
56                                    info = NULL, warning = NULL, danger = NULL) {
57  theme <- assert_global_theme("bs_global_accent_colors()")
58  theme <- bs_accent_colors(
59    theme, primary = primary, secondary = secondary, success = success,
60    info = info, warning = warning, danger = danger
61  )
62  bs_global_set(theme)
63}
64
65#' @rdname deprecated
66#' @export
67bs_theme_fonts <- function(...) {
68  .Deprecated("bs_global_fonts")
69  bs_global_fonts(...)
70}
71
72bs_global_fonts <- function(base = NULL, code = NULL, heading = NULL) {
73  theme <- assert_global_theme("bs_global_fonts()")
74  theme <- bs_fonts(theme, base = base, code = code, heading = heading)
75  bs_global_set(theme)
76}
77
78#' @rdname deprecated
79#' @export
80bs_theme_add_variables <- function(...) {
81  .Deprecated("bs_global_add_variables")
82  bs_global_add_variables(...)
83}
84
85#' @rdname deprecated
86#' @export
87bs_theme_add <- function(...) {
88  .Deprecated("bs_global_bundle")
89  bs_global_bundle(sass::sass_layer(...))
90}
91
92
93#' @rdname deprecated
94#' @export
95bs_theme_get_variables <- function(...) {
96  .Deprecated("bs_global_get_variables")
97  bs_global_get_variables(...)
98}
99
100bs_global_get_variables <- function(varnames) {
101  theme <- assert_global_theme("bs_global_get_variables()")
102  bs_get_variables(theme, varnames)
103}
104
105#' @rdname deprecated
106#' @export
107bootstrap <- function(theme = bs_theme_get(), ...) {
108  .Deprecated("bs_theme_dependencies")
109  bs_theme_dependencies(theme, ...)
110}
111
112#' @rdname deprecated
113#' @export
114bootstrap_sass <- function(rules = list(), theme = bs_theme_get(), ...) {
115  .Deprecated("sass::sass_partial")
116  theme <- as_bs_theme(theme)
117  theme$rules <- ""
118  sass_partial(rules, theme)
119}
120
121#' @rdname deprecated
122#' @export
123bs_add_declarations <- function(theme, declarations) {
124  .Deprecated("bs_add_mixins")
125  bs_bundle(theme, sass_layer(declarations = declarations))
126}
127