Skip to content

Commit

Permalink
Merge pull request gadenbuie#40 from gadenbuie/feat/no-controls
Browse files Browse the repository at this point in the history
feat(css): Add `no-controls` class
  • Loading branch information
gadenbuie authored Jan 21, 2024
2 parents c2b5280 + dcfd3ca commit 9354a42
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
* Set `class = "inline"` in `countdown()` to create an inline, rather than
absolute-positioned, countdown timer. (#36)

* Set `class = "no-controls"` in `countdown()` to create a countdown timer
without the controls. (#40)

## Bug fixes

* Fixed an issue where custom URLs for `play_sound` were not used for the timer
Expand Down
6 changes: 6 additions & 0 deletions R/countdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
#' containing the timer. The `"countdown"` class is added automatically. If
#' you want to modify the style of the timer, you can modify the `"countdown"`
#' class or specify additional styles here that extend the base CSS.
#'
#' `countdown()` provides two built-in classes:
#'
#' * Use `"inline"` to create an inline, rather than absolutely-positioned,
#' timer. This is useful for timers in prose or documents.
#' * Use `"no-controls"` for a timer without the up/down controls.
#' @param style CSS rules to be applied inline to the timer. Use `style` to
#' override any global CSS rules for the timer. For example, to display the
#' timer relative to the position where it is called (rather than positioned
Expand Down
3 changes: 2 additions & 1 deletion inst/countdown/countdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
}

/* ------ Controls ------ */
.countdown:not(.running) .countdown-controls {
.countdown:not(.running) .countdown-controls,
.countdown.no-controls .countdown-controls {
display: none;
}

Expand Down
9 changes: 8 additions & 1 deletion man/countdown.Rd

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

0 comments on commit 9354a42

Please sign in to comment.