Skip to content

How to disable checkboxes in the rendered home page? #2901

Closed
@jmgirard

Description

@jmgirard

I want to have a checkbox list on my README that gets posted on the home page, but I don't want the items to be interactive in HTML (i.e., I don't want the user to be able to click them to toggle them on or off).

Steps for MWE:

  1. Open RStudio
  2. File > New Project > New R Package
  3. usethis::use_readme_rmd()
  4. usethis::use_pkgdown()
  5. Edit README.Rmd to contain:
---
output: github_document
---

- [ ] unfilled
- [x] filled
  1. devtools::build_readme()
  2. pkgdown::build_site()
  3. Click on the checkboxes or list text to toggle them on/off

I tried adding CSS directly and via a .css file but am struggling to get this to be reflected in the HTML.
I believe the CSS is correct and this issue is more of how to get the CSS into that HTML file via pkgdown:

ul.task-list input[type="checkbox"] {
  pointer-events: none;
  cursor: default;
  accent-color: gray;
}
ul.task-list label {
  pointer-events: none;
  cursor: default;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions