feat: implement 9 W3.CSS helper components (#2, #5, #12, #15, #17, #19, #20, #21, #26)#34
Open
VincentGuyader wants to merge 3 commits intomasterfrom
Open
feat: implement 9 W3.CSS helper components (#2, #5, #12, #15, #17, #19, #20, #21, #26)#34VincentGuyader wants to merge 3 commits intomasterfrom
VincentGuyader wants to merge 3 commits intomasterfrom
Conversation
…ons/progressbar Closes stub TODOs: alerts (#2), code (#5), icons (#12), margins (#15), notes (#17), progressbar (#19), quotes (#20), round (#21), tags (#26). All renderers return htmltools tags compatible with {shiny}. Simple class-returning helpers (w3_round, w3_margin) follow the existing w3_badge/w3_color style.
- Add role='progressbar' and aria-valuenow/min/max on w3_progressbar so screen readers announce the value (W3.CSS docs leave this to the caller; opting in here makes the helper accessible by default). - Drop the four-level match.arg() on w3_alert(level = ...). The full W3 palette is supported by w3_color(), and clamping the alert helper to red/yellow/green/blue was an arbitrary subset.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the 9
R/todo_w3css_*.Rstubs with working implementations. All renderers returnhtmltoolstags compatible with Shiny; class-returning helpers (w3_round,w3_margin) follow the existingw3_colorstyle.w3_alert(..., level)—<div class="w3-panel w3-COLOR">w3_code()+w3_codespan()—<pre>/ inline<code>w3_icon(name, library)— Font Awesome or W3 setw3_margin(side)— returns the CSS classw3_note(..., level)—w3-leftbarpale panelw3_progressbar(value)— clamped[0, 100], withrole="progressbar"andaria-valuenow / valuemin / valuemaxso screen readers announce it correctlyw3_quote(...)— styled<blockquote>w3_round(size)— returns the CSS classw3_tag(..., color, round)—<span class="w3-tag …">w3_alert(level = …)accepts the full W3 palette viaw3_color()(validation delegated there), instead of being clamped to red/yellow/green/blue.The 18 remaining
R/todo_w3css_*.Rstubs (accordions, sidebar, slideshow, navigation, layout, tabulators, checkbox…) need design decisions and were left out.Test plan
tests/testthat/test-todo-batch.R: 47 PASS — class strings, structure, ARIA attributes, value clamp,w3_round/w3_marginexact class outputs,w3_alertaccepting anyw3_colorvalue.R CMD check: 0 ERROR / 0 WARNING / 0 NOTE.Closes #2
Closes #5
Closes #12
Closes #15
Closes #17
Closes #19
Closes #20
Closes #21
Closes #26