File tree 5 files changed +66
-19
lines changed
5 files changed +66
-19
lines changed Original file line number Diff line number Diff line change 15
15
opacity : 1 ;
16
16
}
17
17
18
+ & .DocsLink-sm {
19
+ border-radius : var (--border-radius-sm , .5rem );
20
+ height : 52px ;
21
+ opacity : 1 ;
22
+ padding : var (--space-small , .25rem ) var (--space-large , 1rem );
23
+ transform : translateY (50% );
24
+
25
+ p {
26
+ margin-bottom : 0 ;
27
+ }
28
+
29
+ svg {
30
+ fill : none ;
31
+ position : relative ;
32
+ bottom : 2px ;
33
+ }
34
+
35
+ & :hover {
36
+ transform : translateY (50% );
37
+ }
38
+ }
18
39
}
19
40
.DocsLink_content {
20
41
display : flex ;
Original file line number Diff line number Diff line change 17
17
#[AsTwigComponent]
18
18
class DocsLink
19
19
{
20
+ public string $ size = 'md ' ;
20
21
public string $ url ;
21
22
public string $ title ;
22
- public string $ text ;
23
+ public ? string $ text = null ;
23
24
24
25
public ?string $ icon = null ;
25
26
@@ -28,4 +29,10 @@ public function isExternal(): bool
28
29
{
29
30
return !str_starts_with ($ this ->url , 'https://symfony.com ' );
30
31
}
32
+
33
+ #[ExposeInTemplate]
34
+ public function isSmall (): bool
35
+ {
36
+ return 'sm ' === $ this ->size ;
37
+ }
31
38
}
Original file line number Diff line number Diff line change 1
- <div {{ attributes.defaults ({class : ' DocsLink' }) }}>
1
+ <div {{ attributes.defaults ({class : ' DocsLink DocsLink- ' ~ size }) }}>
2
2
<div class =" DocsLink_content" >
3
- <p class =" DocsLink_title ubuntu-header" >
4
- <a href =" {{ url }}" class =" DocsLink_link"
5
- rel =" {{ isExternal ? ' external noopened noreferrer' }}"
6
- >{{ title }}</a >
7
- {% if icon | default %}
8
- <twig:ux:icon name =" {{ icon }}" class =" Icon DocsLink_arrow" />
9
- {% elseif isExternal %}
10
- <twig:ux:icon name =" arrow-right" style =" transform: rotate(-45deg);" class =" Icon DocsLink_arrow" />
11
- {% endif %}
12
- </p >
13
- <div class =" DocsLink_description" >
14
- <p >{{ text }}</p >
15
- </div >
3
+ {% if isSmall %}
4
+ <p class =" d-flex align-items-center" >
5
+ <twig:ux:icon name =" fluent-emoji-flat:open-book" class =" Icon me-2" font-size =" 32" />
6
+ <a href =" {{ url }}" class =" DocsLink_link"
7
+ rel =" {{ isExternal ? ' external noopened noreferrer' }}"
8
+ >{{ title }}</a >
9
+ </p >
10
+ {% else %}
11
+ <p class =" DocsLink_title ubuntu-header" >
12
+ <a href =" {{ url }}" class =" DocsLink_link"
13
+ rel =" {{ isExternal ? ' external noopened noreferrer' }}"
14
+ >{{ title }}</a >
15
+ {% if icon | default %}
16
+ <twig:ux:icon name =" {{ icon }}" class =" Icon DocsLink_arrow" />
17
+ {% elseif isExternal %}
18
+ <twig:ux:icon name =" arrow-right" style =" transform: rotate(-45deg);" class =" Icon DocsLink_arrow" />
19
+ {% endif %}
20
+ </p >
21
+ {% endif %}
22
+
23
+ {% if text %}
24
+ <div class =" DocsLink_description" >
25
+ <p >{{ text }}</p >
26
+ </div >
27
+ {% endif %}
16
28
</div >
17
29
</div >
Original file line number Diff line number Diff line change 12
12
</p >
13
13
</div >
14
14
15
- {% if command is not defined or command %}
16
- < div class = " d-flex justify-content-center " >
15
+ < div class = " d-flex justify-content-center " >
16
+ {% if command is not defined or command %}
17
17
<twig:TerminalCommand
18
18
aria-label =" Composer command to install {{ package .humanName }}"
19
19
command =" {{ package .composerRequireCommand }}"
20
20
style =" --color-accent: {{ package .color }}; transform: translateY(50%);"
21
21
/>
22
- </div >
23
- {% endif %}
22
+ {% endif %}
24
23
24
+ <twig:DocsLink
25
+ class =" ms-3"
26
+ size =" sm"
27
+ title =" Read the docs"
28
+ url =" {{ package .officialDocsUrl }}"
29
+ />
30
+ </div >
25
31
</div >
26
32
</div >
You can’t perform that action at this time.
0 commit comments