Closed pli888 closed 5 months ago
thanks @pli888,
This is quite enlightening. I wonder if it's also worth tracking here the versions of CSS libraries being in use curently on develop
, because I have advanced the version (minor revision only) on my branch for at least Bootstrap (and use CDN distribution rather than the one copied within the codebase).
@rija
This is quite enlightening. I wonder if it's also worth tracking here the versions of CSS libraries being in use curently on develop, because I have advanced the version (minor revision only) on my branch for at least Bootstrap (and use CDN distribution rather than the one copied within the codebase).
I've added, where available, the version numbers for the CSS libraries to the above table.
I have also found out that the GigaDB website was created using version 1.6 of the Unify bootstrap-based responsive template. Documentation about the Unify template can be downloaded here.
Hi @pli888,
I've looked at the Unify theme's code. I then searched for Unify code snippets in GigaDB codebase and found nothing. My guess is that some selectors and values that renders the Unifiy look-and-feel were replicated by hand in GigaDB. I can definitely see a resemblance between Unify and GigaDB look on public pages. There is some organisation in the Unify CSS files. None of it is replicated in GigaDB organisation of the CSS files though.
The original organisation of GigaDB's CSS uses a build pipeline for CSS based on LESS, not perfect but it made a good foundation. The CSS codebase has become a mess when some major changes were done that bypassed the CSS build pipeline (which is how common.css
might have come to existence and me adding datatables.css
didn't help setting a good example).
The benefit of a build pipeline for CSS are numerous:
So our strategy for resolving the CSS issue should probably have a build pipeline as backbone.
With that in mind, it would probably be a good idea to also list on this issue the LESS files from the less/
directory as you did for the CSS files: There are still in use, are domain named, and some of them were added post initial introduction (by me).
When both tables are established, it will be easier to see that most files in the css/
directory that are not auto-generated are actually associated with third party libraries/frameworks (the exception being common.css
and datatables.css
) while domain related stylesheets are located in the less/
directory.
I have read the SMACSS book, and I found the advices and guidelines very sound and practical. It matches good practices I've seen elsewhere. I think there's great benefit in using it as foundation for our coding guideline for CSS (because there are still too many directions we could go from the book, we should come up with our own guidelines built upon it but more narrow focused, domain and technology specific).
I found the book's content to complement the last three sections (Module and program/Consistent layouts/Establish patterns) of chapter 8 of Web Style Guide (Patrick J. Lynch and Sarah Horton, Harvard Press) in which they highlight the importance of developing our own pattern library. Here are the benefits they list (quoting the book):
The one page pattern library would be the example part of a CSS coding guidelines.
Here's a suggested step by step approach toward resolution of the CSS situation:
common.css
and datatable.css
, and see what breaks on the current site from develop branch. Then, one by one, fix the CSS by creating the files in the less
directory and add there the selectors that would fix a breakage, using SMACSS and Bootstrap documentation (and maybe Unify) as guides (creating new files instead of using existing ones, later it would be easier to remove the old ones).The above doesn't have to be perfect immediately, it just has to work good enough. We can always refine later as the process, conventions and starting from a good foundation are the most important.
Things that, IMHO, do not require immediate decision and can be left for later after the fire is extinguished:
css/
directory.Let me know your views on all this.
@rija I have broken down common.css
into groups of new less
files. You can view these on my fork. This is work in progress but obviously the set of less
files need to be cleaned and refined.
I have started work on a pattern library for GigaDB using this tool. With the code in the fix-css-less
branch of my fork, you can view the pattern library at http://gigadb.gigasciencejournal.com:9170/style-guide/index.php. At the moment, I have only listed the colours which are used in common.css
.
The pattern library is now available on staging server.
Diagrams showing how components in the pattern library are organised in web pages are available here.
clsoing this as luis has now fixed these styling issues.
There are two layouts being used in GigaDB:
These layouts are being generated by CSS files (some via less files) and Yii view classes:
CSS files
*This file is created from site.less using lesscompilercommand in webapp_setup.sh script which is executed by
docker-compose.yml
anddocker-compose.staging.yml
.Less files
Files in views/layouts directory
The views that uses column2.php can also use column1.php without any change is layout as there is nothing in sidebar.