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

feat: Add eLife styling for publication date #114

Merged
merged 8 commits into from
Apr 1, 2020
Merged

feat: Add eLife styling for publication date #114

merged 8 commits into from
Apr 1, 2020

Conversation

discodavey
Copy link
Collaborator

First pass for initial styling

@davidcmoulton davidcmoulton changed the title feat: Add styling for date publication feat: Add eLife styling for publication date Mar 24, 2020
@@ -0,0 +1,3 @@
:root {
--text-size-small: 0.6875;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity should include rem in the name as the unit is not in the value.

@@ -13,6 +13,8 @@
@import '../../fonts/notoSerif/notoSerif.css';
@import '../../fonts/notoSans/notoSans.css';

@import 'custom-properties.css';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move down to be below any @imports from outside the eLife theme.

@@ -0,0 +1,3 @@
:root {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use :--root to be consistent with the rest of the codebase. Might need to change it later to widen the scope to this, but for now let's start with consistency.

font-family: 'Noto Sans', Arial, Helvetica, sans-serif;
font-size: calc(var(--text-size-small) * 1rem);
line-height: calc(1.5rem / var(--text-size-small));
letter-spacing: 0.5px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether this should be a custom property 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be as all the letter-spacing variables in pattern library are the same. So will add.

@codecov-io
Copy link

codecov-io commented Mar 25, 2020

Codecov Report

Merging #114 into next will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             next     #114   +/-   ##
=======================================
  Coverage   88.95%   88.95%           
=======================================
  Files           4        4           
  Lines         163      163           
  Branches       50       50           
=======================================
  Hits          145      145           
  Misses         18       18           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 14b0264...2d6a694. Read the comment docs.

@@ -15,6 +15,9 @@

@import '../../extensions/person/styles.css';

/* Custom Properties */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments are good, but in this case the file name is self-documenting so don't need this here.

:--datePublished {
font-family: 'Noto Sans', Arial, Helvetica, sans-serif;
font-size: calc(var(--text-size-rem-small) * 1rem);
line-height: calc(1.5rem / var(--text-size-rem-small));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably have the 1.5rem in a custom property too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidcmoulton What should we call this then? Are you sure this is not fragmenting this too much?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot think of a suitable name for this if we are going to use it as a global. I have set it up as if we were going to use it for line-height.

@davidcmoulton
Copy link
Collaborator

@discodavey In your commit messages, please can you add (Elife) before the colon (see examples of previous commits) to make it clear to which theme the changes are addressing.

@discodavey
Copy link
Collaborator Author

@davidcmoulton It maybe worth putting the info about naming conventions for commits in the README file as it's not obvious and would be good information for anyone else who works on the project.

nokome added a commit that referenced this pull request Mar 28, 2020
@discodavey discodavey marked this pull request as ready for review March 30, 2020 10:26
:--root {
--text-size-rem-small: 0.6875;
--letter-spacing: 0.5px;
--line-height-calc: 1.5rem;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This represents the standard baseline grid measure on eLife (24px), expressed in rem, so would name it something like --baseline-measure-rem

Copy link
Collaborator

@davidcmoulton davidcmoulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking okay 👍

Next I guess it's the colour and horizontal alignment?

Also, to get the date formatting as it should you'll need to merge the current next branch into your feature branch.

Copy link
Collaborator

@davidcmoulton davidcmoulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking pretty good 👍

While you're at it, can you get the spacing between the author list and the date the same as eLife too? It's the equivalent of 24px on an eLife article.

/* Colors */
--color-text-secondary: #888;

/* Typography */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably don't need these comments (here and on line 2) as it seems pretty well self documenting at the moment. Note that the baseline custom property is not typography but spacing.

Copy link
Collaborator Author

@discodavey discodavey Apr 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the comments I was just bringing them over from the Pattern Librtary hence why they are there. In my opinion I think they are valid as it's easier to scan comments quicker rather than looking at the code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidcmoulton With the spacing on the author list does this need to be a separate PR as the spacing would be on the bottom of the Author List rather than the top of the date?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@discodavey Happy to have a separate PR as part of the same ticket.

@davidcmoulton davidcmoulton merged commit 0fe8a36 into stencila:next Apr 1, 2020
@davidcmoulton
Copy link
Collaborator

Merged into next, but master has just taken over as the default branch 🤔

@discodavey can you raise a new PR from your feature branch into master, and put a comment linking to this one to keep the comment history please?

@alex-ketch Presumably open PRs currently targeting next should be retargeted to master now? I can do the eLife ones. Once next has no open PRs against it, is it worth deleting it?

@nokome
Copy link
Member

nokome commented Apr 1, 2020

Hi @davidcmoulton just saw the bot notif about this.

Presumably open PRs currently targeting next should be retargeted to master now? I can do the eLife ones. Once next has no open PRs against it, is it worth deleting it?

Yes on both counts IMO.

@davidcmoulton
Copy link
Collaborator

Confirming open eLife PRs are now against master.

@discodavey discodavey mentioned this pull request Apr 3, 2020
@stencila-ci
Copy link
Collaborator

🎉 This PR is included in version 2.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants