🌐 AI搜索 & 代理 主页
Skip to content

Commit c96fc6c

Browse files
authored
Update README.md
1 parent cc54ddf commit c96fc6c

File tree

1 file changed

+63
-4
lines changed

1 file changed

+63
-4
lines changed

src/icons/README.md

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ You can also use the prop `font-scale` to scale the icon's current font size by
209209
<!-- icons-size-font-size-prop.vue -->
210210
```
211211

212+
Also see the [scaling transforms](#scale) section below for additional sizing options.
213+
212214
## Styling
213215

214216
With the use of Bootstrap's border and background
@@ -280,16 +282,16 @@ icons.
280282
<template>
281283
<b-row cols="2" cols-sm="4" class="text-center" style="font-size: 4rem;">
282284
<b-col class="mb-2">
283-
<b-icon icon="alert-circle" scale="0.5" class="bg-secondary"></b-icon>
285+
<b-icon icon="alert-circle" scale="0.5" class="bg-info"></b-icon>
284286
</b-col>
285287
<b-col class="mb-2">
286-
<b-icon icon="alert-circle" class="bg-secondary"></b-icon>
288+
<b-icon icon="alert-circle" class="bg-info"></b-icon>
287289
</b-col>
288290
<b-col class="mb-2">
289-
<b-icon icon="alert-circle" scale="1.5" class="bg-secondary"></b-icon>
291+
<b-icon icon="alert-circle" scale="1.5" class="bg-info"></b-icon>
290292
</b-col>
291293
<b-col class="mb-2">
292-
<b-icon icon="alert-circle" scale="2" class="bg-secondary"></b-icon>
294+
<b-icon icon="alert-circle" scale="2" class="bg-info"></b-icon>
293295
</b-col>
294296
</b-row>
295297
</template>
@@ -300,6 +302,63 @@ icons.
300302
If you need to have the background and/or border scale with the icon, use the `font-scale`
301303
prop instead.
302304

305+
### Shifting
306+
307+
Shifting affects icon location without changing or moving the svg container. To move icons on the
308+
horizontal and/or vertical axis, use the `shift-h` and `shift-v` props with any arbitrary numeric
309+
value, including decimals.
310+
311+
For `shift-v`, positive values will move the icon upwards, while negative values will move the
312+
icon downwards. For `shift-h`, positive values will move the icon to the right, while negative
313+
values will move it left. Both props accept values that are in units of 1/16em (relative to the
314+
icon's current size).
315+
316+
For clarity in the example, we’ve added a background color on the icon so you can see the effect.
317+
318+
```html
319+
<template>
320+
<b-row cols="2" cols-sm="4" class="text-center" style="font-size: 4rem;">
321+
<b-col class="py-4 mb-2">
322+
<b-icon icon="alert-circle" class="bg-info"></b-icon>
323+
</b-col>
324+
<b-col class="py-4 mb-2">
325+
<b-icon icon="alert-circle" shift-v="8" class="bg-info"></b-icon>
326+
</b-col>
327+
<b-col class="py-4 mb-2">
328+
<b-icon icon="alert-circle" shift-v="-8" class="bg-info"></b-icon>
329+
</b-col>
330+
<b-col class="py-4 mb-2">
331+
<b-icon icon="alert-circle" shift-h="8" class="bg-info"></b-icon>
332+
</b-col>
333+
<b-col class="py-4 mb-2">
334+
<b-icon icon="alert-circle" shift-h="-8" class="bg-info"></b-icon>
335+
</b-col>
336+
<b-col class="py-4 mb-2">
337+
<b-icon icon="alert-circle" shift-v="16" class="bg-info"></b-icon>
338+
</b-col>
339+
<b-col class="py-4 mb-2">
340+
<b-icon icon="alert-circle" shift-h="-8" shift-v="-8" class="bg-info"></b-icon>
341+
</b-col>
342+
<b-col class="py-4 mb-2">
343+
<b-icon
344+
icon="alert-circle"
345+
scale="0.5"
346+
rotate="45"
347+
shift-h="-4"
348+
shift-v="4"
349+
class="bg-info"
350+
></b-icon>
351+
</b-col>
352+
</b-row>
353+
</template>
354+
355+
<!-- icons-transform-shift.vue -->
356+
```
357+
358+
Sifting is applied after any scaling and rotation transforms. As with scaling, backgrounds and
359+
borders are not affected. If you need to shift the border/background with the icon, use Bootstrap's
360+
margin [spacing utility classes](/docs/reference/utility-classes).
361+
303362
## Using in components
304363

305364
Easily place icons as content in other components.

0 commit comments

Comments
 (0)