Skip to content
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

Updating file upload to be consistent with GDS #91

Closed
wants to merge 1 commit into from

Conversation

rmbielby
Copy link
Contributor

@rmbielby rmbielby commented Jun 28, 2024

Some notes on this one

The reason that it's not picking up the GDS styling is that shiny implements it's own tailored upload input that's different from the standard html method that the GDS assumes:

Shiny

      shiny::tags$label(label, class="govuk-label"),
      shiny::div(id = paste0(inputId,"file_div"), class = "input-group",
          shiny::tags$label(class = "input-group-btn",
                     shiny::span(class = "btn btn-default btn-file",
                          buttonLabel,
                          inputTag
                     )
          ),
          shiny::tags$input(type = "text", class = "form-control",
                     placeholder = placeholder, readonly = "readonly"
          )
      )

You can see that uses the css hierarchical classes input-group, input-group-btn, btn, btn-default, btn-file and form-control. These are all standard in bootstrap.css.

GDS

The GDS html method would translate to something like the following using htmltools::tags():

      shiny::tags$label(label, class="govuk-label"),
      shiny::tags$input(class = "govuk-file-upload", id="inputId", type="file")

So the elements to be styled are just different types of things - Shiny creates it's own button and text input, whilst GDS assumes the standard file upload html input. So it either needs some entirely new css writing I think or the file upload function overhauling to use the tag input(...,file="type").

@rmbielby rmbielby self-assigned this Jun 28, 2024
@rmbielby rmbielby changed the base branch from master to update-to-gds-v5.4 June 28, 2024 14:38
@sarahmwong
Copy link
Collaborator

Raised in issue #93 to fix properly - closing for now as this is a larger issue for someone to take a look at

@sarahmwong sarahmwong closed this Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants