-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also add initial usage to `claims/support/schools#show`, `claims/support/claims#index`, and `claims/support/users#index`.
- Loading branch information
1 parent
29f5071
commit 14f255e
Showing
7 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@import "header"; | ||
@import "page_banner"; | ||
@import "primary_navigation"; | ||
@import "secondary_navigation"; |
98 changes: 98 additions & 0 deletions
98
app/assets/stylesheets/components/_secondary_navigation.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
.app-secondary-navigation { | ||
margin-bottom: govuk-spacing(7); | ||
} | ||
|
||
.app-secondary-navigation__list { | ||
font-size: 0; // Removes white space when using inline-block on child element. | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
|
||
@include govuk-media-query($from: tablet) { | ||
box-shadow: inset 0 -1px 0 $govuk-border-colour; | ||
width: 100%; | ||
} | ||
} | ||
|
||
.app-secondary-navigation__item { | ||
@include govuk-font(19); | ||
box-shadow: inset 0 -1px 0 $govuk-border-colour; | ||
display: block; | ||
margin-top: -1px; | ||
|
||
&:last-child { | ||
box-shadow: none; | ||
} | ||
|
||
@include govuk-media-query($from: tablet) { | ||
box-shadow: none; | ||
display: inline-block; | ||
margin-right: govuk-spacing(4); | ||
margin-top: 0; | ||
} | ||
} | ||
|
||
.app-secondary-navigation__link { | ||
@include govuk-link-common; | ||
@include govuk-link-style-default; | ||
display: block; | ||
padding-top: 12px; | ||
padding-bottom: 17px; | ||
padding-left: govuk-spacing(3); | ||
text-decoration: none; | ||
position: relative; | ||
font-weight: bold; | ||
|
||
@include govuk-media-query($from: tablet) { | ||
padding-left: 0; | ||
} | ||
|
||
&:link, | ||
&:visited { | ||
color: govuk-colour("blue"); | ||
} | ||
|
||
&:focus { | ||
color: govuk-colour("black"); // Focus colour on yellow should really be black. | ||
position: relative; // Ensure focus sits above everything else. | ||
box-shadow: none; | ||
} | ||
|
||
&:focus:before { | ||
background-color: govuk-colour("black"); | ||
content: ""; | ||
display: block; | ||
width: 100%; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
height: 5px; | ||
} | ||
} | ||
|
||
.app-secondary-navigation__link[aria-current="page"] { | ||
color: govuk-colour("black"); | ||
position: relative; | ||
text-decoration: none; | ||
|
||
&:before { | ||
background-color: govuk-colour("blue"); | ||
content: ""; | ||
display: block; | ||
height: 100%; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
width: 5px; | ||
|
||
@include govuk-media-query($from: tablet) { | ||
height: 5px; | ||
width: 100%; | ||
} | ||
} | ||
|
||
&:focus:before { | ||
background-color: govuk-colour("black"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="app-secondary-navigation"> | ||
<ul class="app-secondary-navigation__list"> | ||
<% navigation_items.each do |navigation_item| %> | ||
<%= navigation_item %> | ||
<% end %> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class SecondaryNavigationComponent < ApplicationComponent | ||
renders_many :navigation_items, "NavigationItemComponent" | ||
|
||
class NavigationItemComponent < ApplicationComponent | ||
attr_reader :name, :url | ||
|
||
def initialize(name, url, classes: [], html_attributes: {}) | ||
@name = name | ||
@url = url | ||
|
||
super(classes:, html_attributes:) | ||
end | ||
|
||
def call | ||
content_tag(:li, class: "app-secondary-navigation__item") do | ||
link_to name, url, class: "app-secondary-navigation__link", aria: { current: current_page?(url) && "page" } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters