-
Notifications
You must be signed in to change notification settings - Fork 12
Is converting of ui.jqgrid.css from CSS to LESS good? #67
Comments
Like I've written in my other post: The current LESS files are not very organized. Basically what I did was to take the old CSS file and split it into multiple files according to the comments (like this one: https://github.com/OlegKi/jqGrid/blob/master/css/ui.jqgrid.css#L14). I then converted the CSS selectors into nested LESS statements, but without changing the logic (of course I may have changed some logic without noticing it). so what you write about But this is only the first version. I fully plan to do the file more properly later on, and I want to introduce variables, so that on can control e.g. the border color by changing only one line of code. LESS building is integrated into |
P.S.: The generated CSS in the |
@flack Sorry, but one can't see the file on https://github.com/openpsa/grid.js. Compare with the folder structure here for example. |
@OlegKi That's because the |
@flack It's absolutely clear for me. I miss the file I think that |
Well, I think end users should use the minified CSS, and that is available in https://github.com/openpsa/grid.js/blob/master/dist/grid.js-0.1.0.min.css Of course we could add the uncompressed file as well, but IMO it would only invite the wrong usage: Because when users get the uncompressed file, they will be tempted to make their own local modifications, and then they will have problems when they update to a newer release later on |
It seem that I understand now how to explain the problem which I have with LESS files. The first case: I use github repository not only in a projects. If I wrote an answer on the stackoverflow or describe a bug in a forum or in some issue I permanently include references to the line of source code (.js file) of to the line of CSS file (like to the line). I can't reference minimized version of the file. The next problem: I use minimized versions of JavaScript and CSS files almost only in solution installed in production. I used to use non-minimized versions. For example I have a page where I included Moreover the the usage of LESS version of CSS is close to rewriting of some modules in TypeScript of CoffeeScript language. It would be very good for people, who uses the same language as his developer language, but if not, then one will have only problems. In any way I still don't know any argument which shows some clear advantage for the end users of transformation |
Your development workflow can be enabled if we tell grunt to also compile a source map. Then, the inspector will point you to the source file line. See e.g.: http://code.tutsplus.com/tutorials/working-with-less-and-the-chrome-devtools--net-36636 But if you start developing a bit with less, you will find that you really don't use it very much. The advantage of less to the developer is that it makes the CSS structure feel a lot the the DOM of the page, so after a while, you know pretty much without thinking where the selector you're looking for is. Of course, this is assuming that the less files are properly structured (which will happen gradually). For the end user (using the compressed CSS), there is no advantage. But there is no disadvantage either. People who use less already, or who don't mind using it, an advantage is that we can provide them with an easy way to customize the layout. If users include our less files into their code, they can do for example this: // Import default layout
@import 'grid.less';
// do some customizations
@grid-default-font-size: 13px;
@grid-border-color: #ccc; This is just an example. Actually, there are no variables defined yet. But we can do it, and this will also make development easier (because you if you want to change e.g. the border-width globally, you would only have to modify one line of code). If you think you need an uncompressed version of the CSS available on github, we can add it easily. But I really wonder: Wouldn't it be easier to just post screenshots from the inspector, or doesn't stackoverflow support that? |
Thank you for adding uncompressed CSS! |
@OlegKi try beautify css on google. |
@bouks: Thank you! If the most other prefer such format, then I can live with it. I'll reformat |
see the discussion openpsa/jsgrid#67 for the description of the reason.
You're welcome. |
Ok closing. |
I don't see sense in converting
ui.jqgrid.css
from one CSS file to multiple LESS files which have no logic internally. Thedist
folder don't containsui.jqgrid.css
file. For me personally the information devided in multiple files https://github.com/openpsa/grid.js/tree/master/less is more difficult to read, to compare and to analyse. In any way one need to have staticui.jqgrid.css
files which can be loaded from static HTML file and just displays the jqGrid.To analyse
ui.jqgrid.css
I personally use always an example of the grid because jqGrid have a lot of jQuery UI classes. In the same way I test the grid together wit Bootsrap. So one have seeui.jqgrid.css
*in combination with jQuery UI and other classes from common frameworks. Only analyzing the conflicts with the frameworks allows to set correct CSS rule inui.jqgrid.css
. The topp level jqGrid component with the class.ui-jqgrid
(known under the name gbox), another important part.ui-jqgrid-view
(gview) and some other will be applied on other CSS rules. The separation in the LESS files makes (at least for me) more difficult to see all classes which will be applied and all looks not like it is in reallity.It is very difficult to compare the resulting CSS with original
ui.jqgrid.css
or withui.jqgrid.css
from my fork.For example look like
ui-jqgrid-pager
,.ui-pager-control
,.ui-jqgrid-toppager
and eventd select
are exist directly under.ui-jqgrid
. Such rules on.ui-jqgrid td select
seems be applied on the whole grid inclusive jqGrid body (btable) with the main data of the grid. Is it so? Where I can see the resultingui.jqgrid.css
? It would be better to have the file in more compact form so that one can see multiple CSS rules without scrolling vertical, which I need to do permanently if I look at the most LESS files.It's my main problems in understanding of new `ui.jqgrid.css in LESS formaz...
The text was updated successfully, but these errors were encountered: