-
Notifications
You must be signed in to change notification settings - Fork 2.1k
update theme documentation reference links & clarify differences between theme_set and theme_update() #3782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…between theme_set() and theme_update() with examples, references #3294
R/theme-current.R
Outdated
#' theme element will default to the values they are set in the theme. | ||
#' `theme_replace` uses `%+replace%` to completely replace the element, so any | ||
#' unspecified values will overwrite the current value in the theme with | ||
#' `NULL`s. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be singular, "NULL
" not "NULL
s".
R/theme-current.R
Outdated
#' | ||
#' # `theme_set()` completely overrides the current theme. | ||
#' # `theme_update()` modifies a particular element of the current theme. | ||
#' theme_set(theme_classic()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A similar example is already given further up in the examples. Please move this entire block up and merge with the previous example of theme_set()
. Also, it's important to undo any changes to the default theme at the end of the example.
R/theme-current.R
Outdated
#' | ||
#' The main difference between `theme_set()` and `theme_update()` is: | ||
#' * `theme_set()` completely overrides the current theme. | ||
#' * `theme_update()` modifies a particular element of the current theme. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't theme_replace()
also be listed in this bullet point list?
R/theme-current.R
Outdated
#' p | ||
#' | ||
#' theme_update(panel.grid.major.y = element_line(colour = "gray")) | ||
#' p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example needs to be moved up also, together with the previous one.
…ary, merge all update/set/replace examples into one section, references #3294
… comparison, references #3294
Sorry, the example still doesn't quite show what I mean. Try the following instead: # minor tick lines remain thin
theme_update(panel.grid.minor = element_line(colour = "red"))
...
# minor tick lines turn thick
theme_replace(panel.grid.minor = element_line(colour = "red"))
... |
closes #3294