website icon indicating copy to clipboard operation
website copied to clipboard

Styles should be pulled out into a separate project/git submodule

Open aroman opened this issue 9 years ago • 11 comments

This will make it easier to use the elementary frontend CSS framework ("elementary.css") without having to either:

A) direct link to elementary.io/styles/main.css, as one project currently does B) copy/snapshot the CSS from this repo and manually keep it up to date.

Git submodules are designed to solve this problem. We should use one :)


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

aroman avatar Jul 05 '15 10:07 aroman

I'm not massively familiar with sub-modules, but I recall hearing that they cause a few issues. A cursory Google shows some negative results on the first page for "git submodule". They are a pain to maintain.

https://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/ http://ayende.com/blog/4746/the-problem-with-git-submodules http://somethingsinistral.net/blog/git-submodules-are-probably-not-the-answer/

lewisgoddard avatar Jul 23 '15 21:07 lewisgoddard

What would you propose instead?

Sent from my iPhone

On Jul 23, 2015, at 17:10, Lewis Goddard [email protected] wrote:

I'm not massively familiar with sub-modules, but I recall hearing that they cause a few issues. A cursory Google shows some negative results on the first page for "git submodule". They are a pain to maintain.

https://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/ http://ayende.com/blog/4746/the-problem-with-git-submodules http://somethingsinistral.net/blog/git-submodules-are-probably-not-the-answer/

— Reply to this email directly or view it on GitHub.

aroman avatar Jul 23 '15 21:07 aroman

I think a repository containing a stylesheet and a couple of test pages with plenty of elements is a good idea, but I don't think there's a need to version manage it. Automatically pulling it in could break stuff, so we could just version it and do it manually, which seems like it would cause far less headaches.

lewisgoddard avatar Jul 23 '15 21:07 lewisgoddard

What you just described is how git submodules work :)

aroman avatar Jul 23 '15 21:07 aroman

I mean I would like to pull in just 1 file, only when I choose, from another repository. That doesn't seem like it should need an entire new pattern when people want to propose changes.

lewisgoddard avatar Jul 23 '15 21:07 lewisgoddard

like I said, that's how submodules work, and they're used very widely. Maybe we're not on the same page here —you're proposing is having a separate repository, and every time we want to bump to latest we need to:

  1. switch to a different repo
  2. fetch and pull latest changes from origin
  3. manually copy the file we want from this repo into the original repo
  4. git add <new file>
  5. git commit -m "bump theme file"

Instead of:

  1. git submodule update

aroman avatar Jul 23 '15 21:07 aroman

I wonder if we could just use an actual package manager (bower or npm or something) to depend on the theme? That's probably the cleanest abstraction and everyone already understands how they work (unlike git submodules, which are definitely not the most intuitive part of git... which is saying a lot)

aroman avatar Jul 23 '15 21:07 aroman

You wouldn't need to pull the repo, just download that one file, then file a merge request like we do for translations or chart updates. It seems unnecessary for us to include an entirely new packaging mechanism for one stylesheet, especially since we could link to something like JSDelivr, and have all our properties update automatically.

lewisgoddard avatar Jul 23 '15 23:07 lewisgoddard

Ultimately, so long as updating is well documented, I'm not opposed to any method.

lewisgoddard avatar Jul 23 '15 23:07 lewisgoddard

Personally I think a git submodule would be a better route because if we add a package manager, not only does mvp have yet another development dependency, but every other project that uses the style does as well.

While we are at it, I think this would be a good chance to look through all the css, and fix some of the weird issues it has. But I would wait until webkit2 midori lands in elementary so we can drop support for some of the old browsers.

btkostner avatar Apr 21 '16 04:04 btkostner

Seeing as we are now including the icons via a git submodule, and WebKit2 is in Epiphany (although we will need to support Freya for a while), this might be viable.

lewisgoddard avatar Sep 08 '16 01:09 lewisgoddard