-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add callouts to Govspeak component; Remove information-block #899
Changes from all commits
76ae1a7
6c6fe63
77b0bac
165a145
69bf6da
943d1e1
e3f237c
c2b7820
63cc97e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Govspeak call to action | ||
// http://govuk-component-guide.herokuapp.com/components/govspeak/fixtures/call_to_action | ||
// | ||
// Support: | ||
// | ||
// - alphagov/whitehall: ✔︎ | ||
// - alphagov/govspeak: ✔︎ | ||
|
||
.govuk-govspeak { | ||
.call-to-action { | ||
margin: 2em 0; | ||
background-color: $panel-colour; | ||
padding: 2em; | ||
|
||
&:first-child { | ||
margin-top: 0; | ||
} | ||
|
||
p:last-child, | ||
ul:last-child, | ||
ol:last-child { | ||
margin-bottom: 0; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,16 @@ | |
|
||
.govuk-govspeak { | ||
.example { | ||
border-left: 10px solid $panel-colour; | ||
padding-left: 1.5em; | ||
margin: 2.5em 0; | ||
border-left: 1em solid $panel-colour; | ||
padding: 1em 0 1em 1em; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm 👍 for using
I'd prefer we redefine our spacing system to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ @miaallers thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is this a recommendation for GOV.UK Publishing, or to all services? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That's a big change. For now, using ems in this case improves legibility and makes spacing consistent with other content. We're using the grid classes to define vertical margins on paragraphs etc though: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could move to using multiples of It'd be good to better understand Mia's intentions. I'm aware Mia's out of the office today, so let's hold merging this till Monday, and discuss it then. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought we were using those spacing rules but it seems like we're not so I'm 👍 to merge, we can have a conversation about consistency another time. |
||
margin: 2em 0; | ||
|
||
// Remove margin from the last element | ||
p:last-child, | ||
ul:last-child, | ||
ol:last-child { | ||
margin-bottom: 0; | ||
} | ||
|
||
strong { | ||
display: block; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Govspeak information callout | ||
// http://govuk-component-guide.herokuapp.com/components/govspeak/fixtures/information_callout | ||
// | ||
// Support: | ||
// | ||
// - alphagov/whitehall: ✔︎ | ||
// - alphagov/govspeak: ✔︎ | ||
|
||
.govuk-govspeak { | ||
.info-notice { | ||
border-left: 1em solid $panel-colour; | ||
padding: 1em 0 1em 1em; | ||
margin: 2em 0; | ||
|
||
// Remove margin from the last element | ||
p:last-child, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feels like this could be a mixin and shared between the callouts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I was debating it. I kinda feel it's in few enough places that it doesn't warrant hiding things behind abstractions, but I could be persuaded. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be qualified? Would There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. Probably not? It's hard to know exactly what elements are going to be used inside the callout and so what this could affect, but at the same time that's also a good argument for making it a generic There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @36degrees When I use comments to explain something it usually makes sense to refactor into a named function: eg I prefer the selector to be qualified. It's faster and less risky (eg otherwise it would apply to all of the last list items in a list). If we use a mixin it's easy to add another case if found. |
||
ul:last-child, | ||
ol:last-child { | ||
margin-bottom: 0; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Govspeak warning callout | ||
// http://govuk-component-guide.herokuapp.com/components/govspeak/fixtures/warning_callout | ||
// | ||
// Support: | ||
// | ||
// - alphagov/whitehall: ✔︎ | ||
// - alphagov/govspeak: ✔︎ | ||
|
||
.govuk-govspeak { | ||
.help-notice { | ||
$icon-size: 34px; | ||
$line-height-mobile: 20px; | ||
$line-height-tablet: 25px; | ||
|
||
margin: 2em 0; | ||
|
||
// Add '!' icon | ||
background-image: image-url("icon-important.png"); | ||
background-size: $icon-size $icon-size; | ||
background-repeat: no-repeat; | ||
|
||
@include device-pixel-ratio() { | ||
background-image: image-url("icon-important-2x.png"); | ||
} | ||
|
||
min-height: $icon-size; | ||
padding-left: $icon-size; | ||
|
||
// Center the icon around the baseline | ||
padding-top: ($icon-size - $line-height-mobile) / 2; | ||
|
||
@include media(tablet) { | ||
padding-top: ($icon-size - $line-height-tablet) / 2; | ||
} | ||
|
||
p { | ||
@include bold-19; | ||
margin-left: 1em; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do left and right margins need to be set to 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess not as that should be the default… this is a bit more defensive I guess. And I think I just prefer it to setting
margin-top
,margin-bottom
and leaving the rest to chance?