Skip to content

Commit

Permalink
Merge pull request #30 from dracula/26-add-a-dracula-themed-_brandyaml
Browse files Browse the repository at this point in the history
Add `dracula_brand`
  • Loading branch information
jrdnbradford authored Feb 25, 2025
2 parents bb51f0c + dba9e62 commit 9c946c6
Show file tree
Hide file tree
Showing 12 changed files with 167 additions and 1,271 deletions.
1 change: 0 additions & 1 deletion .Rprofile

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.Rproj.user
.Rhistory
.RData
renv
.Ruserdata
.httr-oauth
/.quarto/
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Imports:
Suggests:
hexbin,
testthat (>= 3.0.0),
vdiffr
vdiffr,
yaml
Config/testthat/edition: 3
Roxygen: list(markdown = TRUE)
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(dracula_brand)
export(dracula_tibble)
export(scale_color_dracula)
export(scale_colour_dracula)
Expand Down
36 changes: 36 additions & 0 deletions R/dracula_brand.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#' @title Dracula Themed _brand.yaml File
#'
#' @description Add a Dracula-themed `_brand.yaml` to your project.
#'
#' @param path Character. The directory where `_brand.yaml` should be copied. Defaults to the working directory.
#'
#' @param force Boolean. If `TRUE`, overwrite existing `_brand.yaml` without prompting. Defaults to `FALSE`.
#'
#' @return Logical. Returns `TRUE` if the file was copied successfully, `FALSE` otherwise.
#'
#' @examples
#' # Copy _brand.yaml to the current working directory
#' dracula_brand()
#'
#' # Copy _brand.yaml to a specific directory
#' dracula_brand(path = "my_project")
#'
#' # Force overwrite if _brand.yaml already exists
#' dracula_brand(force = TRUE)
#'
#' @export
dracula_brand <- function(path = ".", force = FALSE) {
package_path <- system.file("_brand.yaml", package = "dRacula", mustWork = TRUE)
target_path <- file.path(path, "_brand.yaml")

if (file.exists(target_path)) {
if (!force) {
message("_brand.yaml already exists. Set `force = TRUE` to overwrite")
return(invisible(FALSE))
}
}

file.copy(package_path, target_path, overwrite = TRUE)
message("_brand.yaml copied to ", target_path)
return(invisible(TRUE))
}
76 changes: 76 additions & 0 deletions inst/_brand.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
meta:
name:
short: Dracula
full: Dracula
link:
home: https://draculatheme.com/dRacula
github: https://github.com/dracula/dRacula

color:
palette:
black: "#282A36"
white: "#F8F8F2"
dark-grey: "#44475A"
blue-grey: "#6272A4"
red: "#FF5555"
orange: "#FFB86C"
yellow: "#F1FA8C"
green: "#50FA7B"
purple: "#BD93F9"
cyan: "#8BE9FD"
pink: "#FF79C6"
background: "#282A36"
foreground: "#F8F8F2"

primary: purple
secondary: cyan
tertiary: blue-grey
success: green
info: blue-grey
warning: orange
danger: red
light: white
dark: black

typography:
fonts:
- family: Fira Code
source: google
weight: [400, 500, 600]
style: [normal, italic]
- family: Inter
source: google
weight: [400, 600, 700]
style: [normal, italic]

base:
family: Inter
weight: 400
size: 16px
line-height: 1.5

headings:
family: Fira Code
weight: 600
line-height: 1.2
color: primary

monospace:
family: Fira Code
weight: 400
size: 0.9em

link:
weight: 600
color: pink
decoration: underline

defaults:
bootstrap:
defaults:
navbar-hover-color: $brand-pink
shiny:
theme:
preset: shiny
rules: |
.navbar-brand { color: $brand-pink }
30 changes: 30 additions & 0 deletions man/dracula_brand.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 0 additions & 23 deletions renv.lock

This file was deleted.

7 changes: 0 additions & 7 deletions renv/.gitignore

This file was deleted.

Loading

0 comments on commit 9c946c6

Please sign in to comment.