Skip to content

Commit

Permalink
feat: .section.level{N} don't need margin-top (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie authored Oct 5, 2023
1 parent f71bc1f commit 2a481f9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# flexdashboard (development version)

* flexdashboard now prevents top margin from being applied to boxes created with flexdashboard's markdown syntax when Bootstrap 5 is used. (#443)

# flexdashboard 0.6.2

## New features
Expand Down
2 changes: 1 addition & 1 deletion inst/www/flex_dashboard/flexdashboard.min.css

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

5 changes: 5 additions & 0 deletions inst/www/flex_dashboard/flexdashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ $custom-nav-color: rgba($custom-nav-active-color, 0.6) !default;
}
}

@for $idx from 1 through 6 {
:where(.section.level#{$idx}) {
margin-top: 0;
}
}

/*
Dashboard CSS derives from Keen IO Dashboards
Expand Down
9 changes: 6 additions & 3 deletions tests/testthat/test_built_css.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ test_that("flexdashboard.min.css has been built", {
pkg_css_file <- system.file("www/flex_dashboard/flexdashboard.min.css", package = "flexdashboard")
pkg_css <- readLines(pkg_css_file)

# If this fails, that means that tools/updateShinyCSS.R needs to be run.
expect_identical(new_css, pkg_css)
# If this fails, that means that tools/updateCSS.R needs to be run.
expect_identical(
new_css,
pkg_css,
label = "Pre-built CSS is out of date, please run `Rscript tools/updateCSS.R`.\n"
)
})

0 comments on commit 2a481f9

Please sign in to comment.