-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Replace holder.js with inline SVG #27633
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
46828f6 to
d90387f
Compare
87af4a6 to
4ddcaec
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
8149d62 to
7816fb2
Compare
|
@m5o: currently it seems the |
92c9be6 to
e759883
Compare
diff --git a/site/_includes/example.html b/site/_includes/example.html
index bdfda309f..3925b7c60 100644
--- a/site/_includes/example.html
+++ b/site/_includes/example.html
@@ -33,10 +33,10 @@ optional: hide_markup - disabled (default)
{%- endif -%}
{%- assign image_alt = include.content
- | replace: '%">', '%">✂️'
- | replace: '</text', '✂️</text'
+ | replace: '<title>', '<title>✂️'
+ | replace: '</title>', '✂️</title>'
| split: '✂️' -%}
- {%- assign image_alt = image_alt[1] | strip -%}
+ {%- assign image_alt = image_alt[1] -%}
{%- for content_chunk in modified_content -%}
{%- if content_chunk contains '<svg class="bd-placeholder-img' -%}
diff --git a/site/_includes/icons/placeholder.svg b/site/_includes/icons/placeholder.svg
index a4340c1d3..69d812a6c 100644
--- a/site/_includes/icons/placeholder.svg
+++ b/site/_includes/icons/placeholder.svg
@@ -28,7 +28,7 @@
{%- capture svg -%}
<svg class="bd-placeholder-img{% if class != '' %} {{ class }}{% endif %}" width="{{ width }}" height="{{ height }}" xmlns="http://www.w3.org/2000/svg"{% if viewBox != '' %} viewBox="{{ viewBox }}"{% endif %} preserveAspectRatio="xMidYMid slice">
- {% if title != ' ' %}<title>{{ title }}</title>{% endif %}
+ <title>{{ title }}</title>
<rect fill="{{ background }}" width="100%" height="100%"/>
<text fill="{{ color }}" dy=".3em" x="50%" y="50%">{{ text }}</text>
</svg>💡 The |
|
The condition might be useless now, but we didn't start with always adding the title :P Thanks for the rest, I will update the patch. EDIT: |
d8133a3 to
567c322
Compare
MartijnCuppens
left a comment
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.
Don't think the docs.min.css should be generated in this PR?
|
True, we'll get that in eventually :) |
df2546d to
1bcd254
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1bcd254 to
26ac924
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
26ac924 to
313925f
Compare
|
Woot, thanks! Seems to be fine so far. |
313925f to
5279c0b
Compare
2461fbb to
0d94436
Compare
MartijnCuppens
left a comment
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.
✅I've just tested this with all the changes, looks good!
* always include the title * make it possible to skip adding the title by passing `title=' '` * remove viewBox since we don't need it
Leftover from old times.
0d94436 to
0e72b59
Compare
|
Thanks @m5o for all the help with this, I really appreciate it <3 |
Replaces holder.js with a non-JavaScript solution.
Holder.js is still used on the example pages, that's why I didn't remove it yet. Merging #27605 could could make it easier to remove.Wow, now I see @m5o did a similar PR a few hours agoTODO:
svgbut instead animgtag<title>?viewBox?Closes #27632 by superseding it and fixes #23185 along the way.