Skip to content

Commit

Permalink
date stacked component initial commit (#373)
Browse files Browse the repository at this point in the history
* date stacked component initial commit

* CC FIXUP

* CC FIXUP

* clean up

* updated default styles for component based on new design

* no bg variant

* styleguide responsiveness

* max width and BEM FIXUP

* incorporate time tag

* Update date-stacked.twig

* fixup! color maps

* fixup! build.

* Update date-stacked.twig
  • Loading branch information
Joe Knox authored and yvonnetangsu committed Jun 18, 2019
1 parent 799dae3 commit 4a07d44
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 0 deletions.
43 changes: 43 additions & 0 deletions core/dist/css/decanter.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@charset "UTF-8";

//
// Date Stacked No Background
//

.su-date-stacked--no-background {
@include padding(0);
background: none;
color: color(text--high-contrast);
}
39 changes: 39 additions & 0 deletions core/src/scss/components/date-stacked/_date-stacked.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@charset "UTF-8";

//
// Date Stacked
//
// Abbreviated month stacked on top of numerical day of the month.
//
// .su-date-stacked--no-background - Black type on transparent background
//
// Markup: ../templates/components/date-stacked/date-stacked.twig
//
// Style guide: Components.Date Stacked
//
.su-date-stacked {
@include modular-spacing('padding', 0);
background: color(bg--reverse);
color: color(text--reverse);
max-width: 87px;
text-align: center;

@include grid-media-only('md') {
max-width: 101px;
}

@include grid-media-only('2xl') {
max-width: 105px;
}

.su-date-stacked__month {
@include big-paragraph;
display: block;
}

.su-date-stacked__day {
@include types;
@include type-b;
display: block;
}
}
9 changes: 9 additions & 0 deletions core/src/scss/components/date-stacked/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@charset "UTF-8";

///
/// ROLL UP
///

@import
'date-stacked',
'date-stacked--no-background';
1 change: 1 addition & 0 deletions core/src/scss/components/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
'button/index',
'card/index',
'cta/index',
'date-stacked/index',
'global-footer/index',
'hero/index',
'link/index',
Expand Down
4 changes: 4 additions & 0 deletions core/src/templates/components/date-stacked/date-stacked.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"month_of_year": "Oct",
"day_of_month": "31"
}
25 changes: 25 additions & 0 deletions core/src/templates/components/date-stacked/date-stacked.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{#
/**
* @file
* Date Stacked Component.
*
* Abbreviated month stacked on top of numerical day of the month.
*
* Available variables:
* - attributes: For additional HTML attributes not already provided.
* - modifier_class: Additional css classes to change look and behaviour.
* - month_of_year: The abbreviated month of the year.
* - day_of_month: The day of the month in digit form.
*/
#}

<div{{ attributes }} class="su-date-stacked {{ modifier_class }}">
{% if month_of_year is not empty %}
<span class="su-date-stacked__month">{{ month_of_year }}</span>
{% endif %}

{% if day_of_month is not empty %}
<span class="su-date-stacked__day">{{ day_of_month }}</span>
{% endif %}

</div>
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4a07d44

Please sign in to comment.