<i class="touchdown"><svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<path d="m41 63h-18a1 1 0 0 1 -1-1 6 6 0 0 1 6-6h8a6 6 0 0 1 6 6 1 1 0 0 1 -1 1zm-16.87-2h15.74a4 4 0 0 0 -3.87-3h-8a4 4 0 0 0 -3.87 3z" />
<path d="m34 45h-4a1 1 0 0 1 -1-1v-5h-17a4 4 0 0 1 -4-4v-31a3 3 0 0 1 6 0v29h36v-29a3 3 0 0 1 6 0v31a4 4 0 0 1 -4 4h-17v5a1 1 0 0 1 -1 1zm-3-2h2v-5a1 1 0 0 1 1-1h18a2 2 0 0 0 2-2v-31a1 1 0 0 0 -2 0v30a1 1 0 0 1 -1 1h-38a1 1 0 0 1 -1-1v-30a1 1 0 0 0 -2 0v31a2 2 0 0 0 2 2h18a1 1 0 0 1 1 1z" />
<path d="m26 29a17.2 17.2 0 0 1 -3.31-.31 3 3 0 0 1 -2.37-2.38 18.52 18.52 0 0 1 -.32-4.37c0-.32 0-.65.09-1a15.62 15.62 0 0 1 .26-1.68 18 18 0 0 1 13.94-13.88 15.82 15.82 0 0 1 1.71-.26l1-.09a18.23 18.23 0 0 1 4.39.28 3 3 0 0 1 2.31 2.38 18.52 18.52 0 0 1 .3 4.37c0 .32 0 .65-.09 1a15.62 15.62 0 0 1 -.26 1.68 18 18 0 0 1 -13.94 13.88 15.82 15.82 0 0 1 -1.67.26l-1 .09q-.52.03-1.04.03zm12-22q-.48 0-1 0l-.86.07a14.1 14.1 0 0 0 -1.49.24 16 16 0 0 0 -12.31 12.4 14.56 14.56 0 0 0 -.24 1.47c0 .29-.05.58-.07.88a15.67 15.67 0 0 0 .24 3.94 1 1 0 0 0 .76.78 15.89 15.89 0 0 0 3.91.24l.86-.07a14.1 14.1 0 0 0 1.49-.24 16 16 0 0 0 12.37-12.42 14.56 14.56 0 0 0 .24-1.47c0-.28.05-.58.07-.88a15.64 15.64 0 0 0 -.24-3.89 1 1 0 0 0 -.73-.78 16 16 0 0 0 -3-.27z" />
<path d="m26 29a17.2 17.2 0 0 1 -3.31-.31 3 3 0 0 1 -2.37-2.38 18.52 18.52 0 0 1 -.32-4.37c0-.32 0-.65.09-1a15.62 15.62 0 0 1 .26-1.68 18 18 0 0 1 13.94-13.88 15.82 15.82 0 0 1 1.71-.26l1-.09a18.23 18.23 0 0 1 4.39.28 3 3 0 0 1 2.31 2.38 18.52 18.52 0 0 1 .3 4.37c0 .32 0 .65-.09 1a15.62 15.62 0 0 1 -.26 1.68 18 18 0 0 1 -13.94 13.88 15.82 15.82 0 0 1 -1.67.26l-1 .09q-.52.03-1.04.03zm12-22q-.48 0-1 0l-.86.07a14.1 14.1 0 0 0 -1.49.24 16 16 0 0 0 -12.31 12.4 14.56 14.56 0 0 0 -.24 1.47c0 .29-.05.58-.07.88a15.67 15.67 0 0 0 .24 3.94 1 1 0 0 0 .76.78 15.89 15.89 0 0 0 3.91.24l.86-.07a14.1 14.1 0 0 0 1.49-.24 16 16 0 0 0 12.37-12.42 14.56 14.56 0 0 0 .24-1.47c0-.28.05-.58.07-.88a15.64 15.64 0 0 0 -.24-3.89 1 1 0 0 0 -.73-.78 16 16 0 0 0 -3-.27z" />
<path d="m42 14a7 7 0 0 1 -7-7 6.93 6.93 0 0 1 .08-1.06 1 1 0 0 1 .92-.83l1-.08a18.23 18.23 0 0 1 4.39.28 3 3 0 0 1 2.31 2.38 18.52 18.52 0 0 1 .3 4.37c0 .32 0 .65-.09 1a1 1 0 0 1 -.82.89 7 7 0 0 1 -1.09.05zm-5-7a5 5 0 0 0 5 5v-.06a15.64 15.64 0 0 0 -.24-3.89 1 1 0 0 0 -.76-.78 15.86 15.86 0 0 0 -3.94-.27z" />
<path d="m26 29a17.2 17.2 0 0 1 -3.31-.31 3 3 0 0 1 -2.37-2.38 18.52 18.52 0 0 1 -.32-4.37c0-.32 0-.65.09-1a1 1 0 0 1 .82-.89 7 7 0 0 1 8.09 6.95 6.93 6.93 0 0 1 -.08 1.06 1 1 0 0 1 -.89.83l-1 .08q-.51.03-1.03.03zm-4-7v.06a15.67 15.67 0 0 0 .27 3.94 1 1 0 0 0 .76.78 15.89 15.89 0 0 0 3.91.24h.06a5 5 0 0 0 -5-5.02z" />
<path d="m29 21a1 1 0 0 1 -.71-.29 1 1 0 0 1 0-1.42l6-6a1 1 0 0 1 1.42 1.42l-6 6a1 1 0 0 1 -.71.29z" />
<path d="m33 19a1 1 0 0 1 -.71-.29l-2-2a1 1 0 0 1 1.42-1.42l2 2a1 1 0 0 1 0 1.42 1 1 0 0 1 -.71.29z" />
<path d="m35 17a1 1 0 0 1 -.71-.29l-2-2a1 1 0 0 1 1.42-1.42l2 2a1 1 0 0 1 0 1.42 1 1 0 0 1 -.71.29z" />
<path d="m31 21a1 1 0 0 1 -.71-.29l-2-2a1 1 0 0 1 1.42-1.42l2 2a1 1 0 0 1 0 1.42 1 1 0 0 1 -.71.29z" />
<path d="m36 58h-8a1 1 0 0 1 -1-1v-13a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v13a1 1 0 0 1 -1 1zm-7-2h6v-11h-6z" />
</svg></i>
{% set className = className ? className ~ ' ' : '' %}
{% set attributes = className ~ icon | trim %}
{% set insert = true %}
{% if iconType is empty or iconType == 'custom' %}
<i class="{{ attributes }}">{% if insert is defined and insert == true %}{{ source('@customIcons/' ~ icon ~ '.svg') }}{% endif %}</i>
{% elseif iconType is not empty or iconType == 'iconoir' %}
<i class="{{ attributes }}">{% if insert is defined and insert == true %}{{ source('@icons/' ~ icon ~ '.svg') }}{% endif %}</i>
{% endif %}
{
"icon": "touchdown"
}
<?php
namespace Theme\Views\Atoms\icon;
use ACFToolkit\Traits\SetWrapperWidth;
use ACFToolkit\Types\CustomAtom;
class Icon extends CustomAtom
{
use SetWrapperWidth;
public string $name = 'icon';
public string $label = 'Icon';
public int $needsJs = 0;
public int $needsVue = 1;
public int $needsVueInitialisation = 0;
public function __construct($name = '', $title = '', $children = [])
{
parent::__construct($name, $title);
$this->addChildren(array_merge($children, [
]));
}
public function getChoices()
{
$customIcons = get_template_directory().'/resources/Views/Assets/dist/custom-icons/*.svg';
$result = [];
$files = glob($customIcons);
foreach($files as $file) {
$filename = basename($file, '.svg');
$result[$filename] = $filename;
}
return $result;
}
}
<?php
namespace Theme\Views\Atoms\icon;
use ACFToolkit\ViewModels\BaseViewModel;
class IconViewModel extends BaseViewModel
{
}
i {
display: inline-block;
width: 26px;
svg {
width: 100%;
vertical-align: top;
}
&.sm {
width: 20px;
}
&.md {
width: 40px;
}
&.lg {
width: 50px;
}
&.xl {
width: 60px;
}
&.star--filled {
svg {
g {
fill: theme('colors.primary');
}
}
}
&.logo {
svg {
g {
fill: theme('colors.primary');
}
}
}
&.logo--white {
svg {
g {
fill: #fff;
}
}
}
&.logo_subline {
svg {
g {
fill: theme('colors.primary');
}
}
}
&.logo_subline--white {
svg {
g {
fill: #fff;
}
}
}
&.logo_subline-subline--accent {
svg {
g {
fill: theme('colors.primary');
&#subline {
fill: theme('colors.accent');
}
}
}
}
&.logo_subline--white-subline--accent {
svg {
g {
fill: #fff;
&#subline {
fill: theme('colors.accent');
}
}
}
}
&.search {
width: 24px;
height: 24px;
}
}
<template>
<i
:class="getTypeClass + '-' + icon + ' ' + className"
v-html="iconSource"
:title="title"
v-if="iconSource"
></i>
</template>
<script>
import IconService from '../../Assets/src/js/services/IconService';
export default {
props: {
className: {
type: String,
default: ''
},
icon: {
type: String,
},
title: {
type: String
},
type: {
type: String,
default: 'custom'
}
},
data: () => {
return {
iconSource: null
}
},
computed: {
getTypeClass(){
return this.type === 'custom' ? 'custom' : 'iconoir'
}
},
async created(){
const {data} = this.type === 'custom' ?
await IconService.getCustom(this.icon) :
await IconService.getIconoir(this.icon)
this.iconSource = data
}
}
</script>
<style>
*[class^="iconoir-"], *[class*=" iconoir-"] {
display: inline-block;
}
</style>
{% include '@atoms/icon/icon.twig' with {
icon: 'icon'
} only %}Fields