Skip to content
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

Create default css theme for styling elements (body, h1, figure, etc) #171

Merged
merged 7 commits into from Feb 1, 2019
Merged

Create default css theme for styling elements (body, h1, figure, etc) #171

merged 7 commits into from Feb 1, 2019

Conversation

vincerubinetti
Copy link
Collaborator

No description provided.

Copy link
Member

@dhimmel dhimmel left a comment

Choose a reason for hiding this comment

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

Likely that we will finish this PR before #169. I don't think there should be any problems with merging this first right @vincerubinetti? (besides that users won't immediately see the effect of all the theme changes).

Can you comment on the fonts? Are all fonts downloaded or are system fonts used? Will all browsers and OSes have the same fonts... etcetera.

/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* import google fonts */
@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,600,700");
@import url("https://fonts.googleapis.com/css?family=Source+Code+Pro");
Copy link
Member

Choose a reason for hiding this comment

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

Do we have to worry about the dependency on Google? For example, doesn't china great 🔥 🗿 block google domains? Would it make sense to host these fonts on https://github.com/greenelab/manubot-resources/ (license permitting).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do they completely block all google.com? I wasn't aware of that. Will they somehow block the whole html document if they see one link to google there?

If they just block the font import, then it will fall back to helvetica, and if the user doesn't have that installed, it'll fall back to whatever sans-serif they have (usually arial).

https://github.com/greenelab/manubot-rootstock/blob/e4b9996a3f9c53207596b9198b1524c2542a6835/build/themes/default.html#L14

Copy link
Member

Choose a reason for hiding this comment

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

So would it be possible to add the font files to manubot-resources and only use those if the googleapis import failed? It looks like they both have licenses that should allow this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually it looks like github doesn't support this:
https://stackoverflow.com/questions/39693837/how-do-i-use-github-to-host-a-webfont

=/

Copy link
Member

Choose a reason for hiding this comment

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

I think a workaround would be to set GitHub pages to deploy the master branch of manubot-resources. One downside is that we wouldn't be able to provide versioning by commit hash then. Ideally, we would keep all links to repos versioned such that they are less likely to break.

Copy link
Member

Choose a reason for hiding this comment

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

Or on second thought, we could make a gh-pages branch that stores versioned files and we commit to not removing them. We use the custom domain resources.manubot.org such that we could even switch web hosts.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would we be able to get the resource from gh-pages properly? Github can host fonts just fine, but when trying to link to the "raw" file, it doesn't work. According to that stackoverflow question, the reason is that gh raw files only support the text mime type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is the font issue blocking this merge? I'm thinking gh-pages won't solve the issue if regular branches can't provide the right mime type. We can always add in our own hosting location of the fonts later. The only change that would be required would be adding an extra @import url() statement below the google ones.

Copy link
Member

Choose a reason for hiding this comment

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

I think the GitHub Pages would properly serve the font files as it seems to be smart with mime types and is intended for hosting.

Not a blocker for merging, as we can always change this later. I think we potentially should, especially since some users do not like the omnipresence of google and would prefer not to use them if possible. In addition, to any potential issues with googleapis being blocked in china.

@dhimmel
Copy link
Member

dhimmel commented Jan 31, 2019

@dongbohu can you review this?

Copy link

@dongbohu dongbohu left a comment

Choose a reason for hiding this comment

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

Left a few comments, mainly on the style of comments.

* Remove border when inside `a` element in IE 8/9.
*/
/* -------------------------------------------------- */
/* headings */

Choose a reason for hiding this comment

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

You may want to delete the trailing */ on this line to make the comments style consistent.

overflow: hidden;
}
/* -------------------------------------------------- */
/* manuscript header */

Choose a reason for hiding this comment

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

Same comment about the trailing */.

margin: 0;
}
/* -------------------------------------------------- */
/* text elements */

Choose a reason for hiding this comment

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

Same comment on the trailing */.

* Define consistent border, margin, and padding.
*/
/* -------------------------------------------------- */
/* section elements */

Choose a reason for hiding this comment

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

Same

Choose a reason for hiding this comment

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

Same issue on lines 142, 175, 256, 269, 287, 313, 324 and 381. (I am not going to label them separately.)

/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* import google fonts */
@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,600,700");
@import url("https://fonts.googleapis.com/css?family=Source+Code+Pro");

Choose a reason for hiding this comment

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

I don't know exactly how the html page is rendered. But does it make sense to put everything between line #7 and last line into a separate CSS file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We're trying to minimize the amount of file inclusion/movement/handling the user has to do. The idea was to have everything needed for one theme in one and only one file. In normal web development circumstances I would have much more separation of files and code, but in this case, where the user has to deal directly with the files locally and also (presumably) doesn't know anything about web development, we wanted the files to be as self-contained as possible. In fact everything except the images are embedded right into the (single) .html file.

Copy link

Choose a reason for hiding this comment

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

👍

Copy link

@dongbohu dongbohu left a comment

Choose a reason for hiding this comment

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

A very minor issue. Everything else is good.

@dhimmel dhimmel merged commit 658bcd7 into manubot:master Feb 1, 2019
dhimmel pushed a commit that referenced this pull request Feb 1, 2019
This build is based on
658bcd7.

This commit was created by the following Travis CI build and job:
https://travis-ci.org/greenelab/manubot-rootstock/builds/487684768
https://travis-ci.org/greenelab/manubot-rootstock/jobs/487684769

[ci skip]

The full commit message that triggered this build is copied below:

HTML themes: rewrite default.html with new style

Merges #171

Various display improvements, simplified code structure with modern
best practices.
dhimmel pushed a commit that referenced this pull request Feb 1, 2019
This build is based on
658bcd7.

This commit was created by the following Travis CI build and job:
https://travis-ci.org/greenelab/manubot-rootstock/builds/487684768
https://travis-ci.org/greenelab/manubot-rootstock/jobs/487684769

[ci skip]

The full commit message that triggered this build is copied below:

HTML themes: rewrite default.html with new style

Merges #171

Various display improvements, simplified code structure with modern
best practices.
@vincerubinetti vincerubinetti deleted the default-theme branch March 12, 2019 13:44
adebali pushed a commit to CompGenomeLab/lemur-manuscript-archive that referenced this pull request Mar 4, 2020
Merges manubot/rootstock#171

Various display improvements, simplified code structure with modern
best practices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants