Skip to content

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

Merged
merged 4 commits into from
Feb 1, 2020

Conversation

Ryo-N7
Copy link
Contributor

@Ryo-N7 Ryo-N7 commented Jan 31, 2020

closes #3294

…between theme_set() and theme_update() with examples, references #3294
#' 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.
Copy link
Member

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 "NULLs".

#'
#' # `theme_set()` completely overrides the current theme.
#' # `theme_update()` modifies a particular element of the current theme.
#' theme_set(theme_classic())
Copy link
Member

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.

#'
#' 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.
Copy link
Member

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?

#' p
#'
#' theme_update(panel.grid.major.y = element_line(colour = "gray"))
#' p
Copy link
Member

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
@hadley hadley added the tidy-dev-day 🤓 Tidyverse Developer Day label Jan 31, 2020
@clauswilke
Copy link
Member

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"))
...

@clauswilke clauswilke merged commit 7e6d125 into tidyverse:master Feb 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tidy-dev-day 🤓 Tidyverse Developer Day
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve theme documentation
3 participants