Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
refactor(Shared): Move designa to shared
Browse files Browse the repository at this point in the history
See last bullet point in #25 (comment)
  • Loading branch information
nokome committed Feb 17, 2020
1 parent 45a55a6 commit b0d7ef8
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .postcssrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"postcss-import-url": { "modernBrowser": true },
"postcss-url": { "url": "rebase" },
"postcss-mixins": {
"mixinsDir": "src/designa/mixins"
"mixinsDir": "src/shared/styles/mixins"
},
"postcss-custom-selectors": {
"importFrom": "src/selectors.css"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Display a `<ol>` or `<ul>` as an inline list of items
separated by some content `$separator`
*/
@define-mixin list-separated $separator: ', ' {
@define-mixin list-inline $separator: ', ' {
display: inline;
list-style: none;
margin: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@import './Person.css';

:--Article {
@mixin CreativeWork;
@extend: --CreativeWork;

max-width: var(--article-content-max-width);
margin-left: auto;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
/*
A mixin for nodes that extend `CreativeWork` (e.g. `Article`, `Figure`).
*/
@define-mixin CreativeWork {
:--CreativeWork {
/*
`authors` property: a comma separated list of authors
*/
:--authors {
@mixin list-separated;
@mixin list-inline;
}

:--references > :--CreativeWork {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/designa/Person.css → src/shared/styles/types/Person.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
the email address/es (leave that to web component).
*/
:--emails {
@mixin list-separated;
@mixin list-inline;

order: 2;

Expand All @@ -56,7 +56,7 @@
of integer links.
*/
:--affiliations {
@mixin list-separated;
@mixin list-inline;

order: 3;

Expand Down
9 changes: 3 additions & 6 deletions src/themes/nature/styles.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '../../shared/styles/shared.css';
@import '../../shared/styles/types/Person.css';
@import 'prismjs/themes/prism.css';
@import '../../shared/fonts/lora/lora.css';
@import '../../shared/fonts/sourceSansPro/sourceSansPro.css';
Expand Down Expand Up @@ -422,10 +423,6 @@ blockquote {
}
}

/* Microdata-based Styles */
@import '../../designa/Entity.css';
@import '../../designa/Person.css';

:--Article {
> :--headline {
padding-left: 50px;
Expand All @@ -440,13 +437,13 @@ blockquote {

:--authors,
:--organizations {
@mixin list-separated;
@mixin list-inline;

display: block;
}

:--organizations {
@mixin list-separated '; ';
@mixin list-inline '; ';

:--Organization > * {
display: inline;
Expand Down
9 changes: 3 additions & 6 deletions src/themes/plos/styles.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import '../../shared/styles/shared.css';
@import 'prismjs/themes/prism.css';
@import '../../shared/fonts/openSans/openSans.css';
@import '../../shared/styles/types/Person.css';

:root {
--max-width: 650px;
Expand All @@ -19,10 +20,6 @@
--bg-color: #fff;
}

/* Microdata-based Styles */
@import '../../designa/Entity.css';
@import '../../designa/Person.css';

:--Article {
> :--headline + div {
max-width: var(--max-width);
Expand All @@ -32,11 +29,11 @@
line-height: normal;

:--authors {
@mixin list-separated;
@mixin list-inline;
}

:--organizations {
@mixin list-separated '; ';
@mixin list-inline '; ';

margin-top: 1.25rem;
display: block;
Expand Down

0 comments on commit b0d7ef8

Please sign in to comment.