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

Utilities for overflow and object fit #36848

Merged
merged 12 commits into from Oct 6, 2022

Conversation

MadeByRaymond
Copy link
Contributor

@MadeByRaymond MadeByRaymond commented Jul 26, 2022

Added "overflow-x" and "overflow-y"

  • Having the same properties as overflow but for just the x and y axises
  • Usecase being I want my y axis to be scrollable but not my x axis
  • E.g a card with a vertical list of items.

Added "object-fit" utilities

  • The CSS object-fit property is used to specify how an <img> or <video> should be resized to fit its container.
  • A responsive alternative to using background-img for a resizable fill/fit image.

@mdo
Copy link
Member

mdo commented Jul 27, 2022

I could be down for these in v5.3.0. Going to play a bit more with them myself and see if we'd want to update any docs to better utilize these. Speaking of, can you take a pass at creating a docs page and/or updates for these?

@MadeByRaymond
Copy link
Contributor Author

I could be down for these in v5.3.0. Going to play a bit more with them myself and see if we'd want to update any docs to better utilize these. Speaking of, can you take a pass at creating a docs page and/or updates for these?

Alright @mdo, I can take a pass at the docs and update the PR.

@MadeByRaymond
Copy link
Contributor Author

@mdo done!

@mdo mdo force-pushed the utilities-for-overflow-and-object-fit branch from eb99552 to 42999b5 Compare August 3, 2022 21:51
@mdo mdo force-pushed the utilities-for-overflow-and-object-fit branch 2 times, most recently from 391c37b to 98e7a83 Compare September 2, 2022 18:50
@mdo mdo force-pushed the utilities-for-overflow-and-object-fit branch from d804a63 to 5e5b10b Compare October 3, 2022 18:18
@mdo
Copy link
Member

mdo commented Oct 3, 2022

Tried my hand at fixing some of the build errors, but could use some help here because I'd like to move onto other things. Looks like the docs build is failing due to the use of markup="img", but without that, the examples fail. Any chance you can update @MadeByRaymond?

@MadeByRaymond
Copy link
Contributor Author

@mdo Updated placeholder "img" markup to address HTML Validation Errors

@MadeByRaymond
Copy link
Contributor Author

@mdo I don't think I should be able to update the .bundlewatch.config file.
Right?

@julien-deramond
Copy link
Member

@mdo I don't think I should be able to update the .bundlewatch.config file. Right?

Given the content of this PR, you can update the following corresponding values of .bundlewatch.config.json by adding a step of 0.25:

FAIL ./dist/css/bootstrap-utilities.css: 8.39KB > 8.25KB (gzip)
FAIL ./dist/css/bootstrap-utilities.min.css: 7.68KB > 7.5KB (gzip)
FAIL ./dist/css/bootstrap.css: 29.44KB > 29.25KB (gzip)
FAIL ./dist/css/bootstrap.min.css: 27.33KB > 27.25KB (gzip)

So for example the modification for bootstrap-utilities.css will be:

diff --git a/.bundlewatch.config.json b/.bundlewatch.config.json
index cea957f5e..0fda9d5d6 100644
--- a/.bundlewatch.config.json
+++ b/.bundlewatch.config.json
@@ -18,7 +18,7 @@
     },
     {
       "path": "./dist/css/bootstrap-utilities.css",
-      "maxSize": "8.25 kB"
+      "maxSize": "8.5 kB"
     },
     {
       "path": "./dist/css/bootstrap-utilities.min.css",

@MadeByRaymond MadeByRaymond requested a review from mdo October 6, 2022 08:59
Daniel O and others added 12 commits October 6, 2022 13:07
- Having the same properties as overflow but for just the x and y axises
- Usecase being I want my y axis to be scrollable but not my x axis
- E.g a card with a vertical list of items.
- The CSS object-fit property is used to specify how an <img> or <video> should be resized to fit its container.
- A responsive alternative to using background-img for a resizable fill/fit image.
- Now includes docs for `overflow-x` and `overflow-y` utilities
- Can now choose to render an img tag or svg
- The image contains a base64 svg generated within the template
- example shortcode updated to detect, replace and render preview of 'img' tags as well
- Documentation added for the 'object-fit' util
- error: Bad value  for attribute "src" on element "img": Illegal character in scheme data: space is not allowed.
- info warning: Self-closing tag syntax in text/html documents is widely discouraged; it's unnecessary and interacts badly with other HTML features (e.g., unquoted attribute values). If you're using a tool that injects self-closing tag syntax into all void elements, without any option to prevent it from doing so, then consider switching to a different tool.
- Added Legibility to the img markup (example.html)
- Fixed issue with example not working properly (because image closing tag no longer has "/>" )
The following values in .bundlewatch.config.json have been updated:
- ./dist/css/bootstrap-utilities.css
- ./dist/css/bootstrap-utilities.min.css
- ./dist/css/bootstrap.css
- ./dist/css/bootstrap.min.css
@mdo mdo force-pushed the utilities-for-overflow-and-object-fit branch from 81b52b5 to 844e108 Compare October 6, 2022 20:07
@mdo mdo merged commit 708a3a0 into twbs:main Oct 6, 2022
@AgentSmith0 AgentSmith0 mentioned this pull request Oct 6, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants