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

Add code snippets for usage via CSS variables #1924

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

LeaVerou
Copy link

@LeaVerou LeaVerou commented Jan 11, 2024

Related to #1760.

While my initial thinking was to generate definitions, including a CSS file with thousands of CSS variables on the :root can make inspecting the root via devtools quite painful, and would weigh quite a bit (basically double the current boostrap-icons.css).
Therefore, it would probably need to be a separate file. But then, you'd need a third file to include both, for rapid prototyping.

I figured a quicker route and a much smaller change is to simply include both snippets on the docs, which makes it far less tedious for users to build their own CSS file.

In terms of IA, since this also requires the icon font, I figured it would go under "Icon font", and not after "Copy HTML" as a separate "Copy CSS" section (my initial thought). To avoid pushing the "Code point" section below the fold, I moved it up, since it's quite small.

Screenshot:
image

And with "See example" expanded:
image

Happy to make any changes needed!

Preview: https://deploy-preview-1924--bootstrap-icons.netlify.app/

@XhmikosR XhmikosR requested a review from mdo January 12, 2024 05:37
@XhmikosR XhmikosR added the docs Improvements or additions to documentation label Jan 12, 2024
@XhmikosR
Copy link
Member

Thanks, looking good! I'll wait for @mdo to check it out too.

BTW, I've been meaning to switch to the icon font in single.html, but I recall I hit some alignment issues. Not related to this PR, but it should make the single icon pages smaller instead of using the inline SVG multiple times.

@LeaVerou
Copy link
Author

Thanks!

Btw I suspect the copy could be better, but I figured I better ship it 🐿️ soon and we can iterate together on what's there rather than endlessly massage the wording in isolation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

2 participants