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

Dead code elimination and documentation #1166

Conversation

jdlrobson
Copy link
Collaborator

Clean up and document the current state of the styles folder.
Please read individual commit messages.

Currently the bundles are slightly too big and CI is failing.
There's no need for these 2 files. Let's merge them.
Going forward, we also want to split up/clean these files and
remove it, so we rename it legacy.less to provide this signal
to other people working with this codebase

Additional change:
* Delete unused script file (static/css/all.cssh) - looks like this
used to be used for concatenation but it is not longer needed.
To avoid confusion, from now on all entry points in the static/css
folder will either be prefixed with `page-` or `js-`

Documentation is added to explain the layout of this folder going
forward

Additional changes:
* The newly named page-design stylesheet is expanded to include the rules
inside legacy.less and is added to the page consistently with other pages
* page-dev continues to be loaded as before - in conjunction with whatever
the stylesheet for that page is
* Books-edit makes use of $static_url to generate its url
* For consistency with other pages, the book widget page now has an id
on its body tag which reflects the name of its css file.
While this file may be useful for development (am not convinced),
lets not encourage the addition of CSS here inside our repo.

We may alternatively decide to remove this file.
On closer inspection these are not needed on the home page and
possibly unnecessary. The "on" class only seems to appear when
used with links inside a ".tools" element and then only when
JavaScript is enabled.

Since it's only added with JavaScript (
inside openlibrary/plugins/openlibrary/js/ol.js) move to js-all
entry point.
Certain styles for the borrowTable component only apply to
the component in certain page categories (admin, plain, user)

Instead of loading them on every page, we load them where needed
on the presumption we'll clean this up later.
No need to load them on all pages.
Also given these styles don't make sense on mobile, stick them
in the desktop media query.
Not referenced anywhere so let's delete.
@mekarpeles
Copy link
Member

LGTM

@mekarpeles mekarpeles merged commit 87b9b18 into internetarchive:master Sep 24, 2018
@jdlrobson jdlrobson mentioned this pull request Sep 24, 2018
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

2 participants