-
Notifications
You must be signed in to change notification settings - Fork 82
fix : add background styling for dark logos in branding documentation #247
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
Open
Ekagrashharma
wants to merge
7
commits into
webpack:main
Choose a base branch
from
Ekagrashharma:fix/icon-bg
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+22
−2
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a4b5ee2
fix(branding): add background styling for dark logos in branding docu…
Ekagrashharma d981689
fix(branding): update background color for dark logos in branding doc…
Ekagrashharma 63257a1
test(mdx): add two test divs
Ekagrashharma 396d74c
Update pages/about/branding.md
Ekagrashharma e7141e3
fix: add darkBg class for logo styling
Ekagrashharma 718cfb4
fix the logo sizing sizing
Ekagrashharma 6d0357d
fixup!
moshams272 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: webpack/webpack-doc-kit
Length of output: 855
🏁 Script executed:
Repository: webpack/webpack-doc-kit
Length of output: 50382
🏁 Script executed:
Repository: webpack/webpack-doc-kit
Length of output: 3313
🏁 Script executed:
Repository: webpack/webpack-doc-kit
Length of output: 303
🏁 Script executed (no clone):
Length of output: 2412
🏁 Script executed:
Repository: webpack/webpack-doc-kit
Length of output: 1158
🏁 Script executed (no clone):
Length of output: 625
🏁 Script executed:
Repository: webpack/webpack-doc-kit
Length of output: 11940
🏁 Script executed (no clone):
Length of output: 658
🏁 Script executed:
Repository: webpack/webpack-doc-kit
Length of output: 315
🏁 Script executed:
Repository: webpack/webpack-doc-kit
Length of output: 12385
🌐 Web query:
Tailwind CSS v4.3.3 preflight img video max-width 100% height auto💡 Result:
In Tailwind CSS v4.3.3, Preflight includes a base style rule that constrains images and videos to prevent them from overflowing their containers [1][2]: img, video { max-width: 100%; height: auto; } This rule ensures that images and videos are responsive by default, maintaining their intrinsic aspect ratio [1][2]. If you need to override this behavior, you can use the max-w-none utility class [1][2]. For cases where you must remove the height: auto rule entirely, common approaches include [3][4]: 1. Disabling Preflight: You can disable Preflight globally if you prefer to manage your own base resets [3][4]. 2. Using Utility Overrides: While it is difficult to revert height: auto to the default browser behavior using simple CSS values, you may need to apply specific heights or use other layout strategies if the default behavior conflicts with your design [3][4]. 3. Custom PostCSS Plugins: Some developers use plugins to strip specific rules from the generated CSS after Tailwind runs [4]. Please note that Tailwind v4.3.3 introduced a fix regarding Preflight and iframes to prevent it from overriding Firefox's native focus-visible outline styles, but the core image and video constraint rules remain unchanged [5][6][7].
Citations:
🏁 Script executed:
Repository: webpack/webpack-doc-kit
Length of output: 2226
🌐 Web query:
CSS inline-block wrapper padding child img max-width 100% intrinsic width overflow table cell💡 Result:
The layout issues you are encountering when nesting an image with max-width: 100% inside an inline-block wrapper—especially within a table cell—stem from cyclic dependencies in how browsers calculate intrinsic widths [1][2][3]. When a container (like an inline-block or a table cell) has an auto width, its size is determined by its content [2][4]. If a child image within that container is set to max-width: 100%, the browser faces a circular dependency: it cannot determine the width of the container without the image, but it cannot determine the width of the image without knowing the width of the container [1][2][3]. Key causes and solutions for these behaviors are detailed below: Circular Dependency in Intrinsic Sizing When the wrapper is inline-block and the child image is set to max-width: 100%, the browser may default to the image's intrinsic (natural) pixel size rather than scaling it to the available space [1][5]. This often causes the wrapper (and consequently the table cell) to expand to the full natural width of the image [1][6][7]. Baseline Gaps Images are inline elements by default [8][6]. Even if you set display: block on an image, it often leaves a small gap at the bottom of a container because it aligns to the baseline of the text, reserving space for typographic descenders [9][10]. To eliminate this, ensure the image is set to display: block or vertical-align: top/bottom [11][9][6]. Fixing Table Cell Overflow If images cause a table cell or its wrapper to exceed expected bounds, consider these strategies: - Use the min function: If you need responsiveness while preventing expansion beyond natural size, use width: min(100%, px) [1]. This breaks the circular dependency by bounding the image's contribution to the table's auto-layout calculation [1]. - Enforce layout: Setting table-layout: fixed on the table can prevent cells from expanding based on image content, forcing them to respect defined column widths [8][12]. - Force Block Behavior: Always set display: block on images inside wrappers to remove inline-related spacing issues [11][6]. - Use min-width: 100% on the wrapper: If using an inline-block wrapper inside an overflow container, adding min-width: 100% ensures the wrapper correctly fills the available scrollable space rather than shrinking to fit the image [13]. If you are using percentage-based padding on the wrapper or child, the browser may ignore the padding during the initial intrinsic width calculation to avoid an infinite loop [3]. Using fixed units (e.g., px, em) for padding often resolves these layout calculation failures [3].
Citations:
Constrain
.darkBgand wrap the stacked logo table.Tailwind Preflight constrains the direct
<img>, but.darkBgcan retain the nested image’s intrinsic width. Its 20px padding can then make the dark cell overflow its fixed 50% column on narrow screens. Add scopedmax-width: 100%andbox-sizing: border-boxrules to.darkBg.The stacked logo table is outside
.halfWidthTable, so it does not receive the fixed-layout or 50% column rules. Move the closing</div>after that table if both tables require equal columns.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ekagrashharma what about the third table 👀