Skip to content

Commit

Permalink
Merge branch 'feature/external-link-icon-class' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
breakdancingcat committed Jul 28, 2023
2 parents 0f19133 + 6d07ad7 commit d8cab0a
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
3 changes: 3 additions & 0 deletions resources/images/external-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions resources/scss/components/_menu-icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,41 @@
.menu-icon:hover::after {
@apply bg-gray-400 shadow-grey;
}

// For under menu items that have class to designate external link
.main-menu .external {
a::after {
content: '(external link)';
font-size: 0;
background-image: url('/_resources/images/external-link.svg');
background-size: contain;
display: inline-block;
margin-left: 7px;
width: 11px;
height: 11px;
filter: invert(100%);
position: relative;
bottom: 1px;
}

@screen mt {
a::after {
filter: invert(0);
}
}
}

.external a.button div:first-of-type::after {
content: '(external link)';
font-size: 0;
background-image: url('/_resources/images/external-link.svg');
background-size: contain;
display: inline-block;
margin-left: 7px;
width: 11px;
height: 11px;
//filter: invert(100%);
position: relative;
top: -11px;
margin-bottom: -11px;
}
31 changes: 31 additions & 0 deletions styleguide/Pages/MenuExternal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Styleguide\Pages;

use Factories\Page as PageFactory;

class MenuExternal extends Page
{
/**
* {@inheritdoc}
*/
public function getPageData()
{
return app(PageFactory::class)->create(1, true, [
'page' => [
'controller' => 'MenuTopController',
'title' => 'Menu external',
'id' => 103100102,
'content' => [
'main' => '
<h2>Setup</h2>
<ul>
<li>Add class "external" to menu links and under-menu items</li>
<li>Suggestion: Use full url for any link considered external.</li>
</ul>
',
],
],
]);
}
}
10 changes: 10 additions & 0 deletions styleguide/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,16 @@
"class_name": "",
"relative_url": "/styleguide/menu/top",
"submenu": []
},
"103100102": {
"menu_item_id": 103100102,
"is_active": 1,
"page_id": 103100102,
"target": "",
"display_name": "External menu icon",
"class_name": "external",
"relative_url": "/styleguide/menu/external",
"submenu": []
}
}
},
Expand Down

0 comments on commit d8cab0a

Please sign in to comment.