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

Allow skipping LESS parser for individual files #2254

Open
iainhallam opened this issue Feb 10, 2018 · 9 comments
Open

Allow skipping LESS parser for individual files #2254

iainhallam opened this issue Feb 10, 2018 · 9 comments

Comments

@iainhallam
Copy link
Contributor

I'm using the Bulma CSS framework, which uses CSS calc() functions for various values, but when these are parsed through LESSPHP, it incorrectly parses these and runs the calculation before the browser has a chance to, so the values are wrong in the finished page.

leafo/lessphp#326

While LESSPHP fixes the issue, is there a way to indicate to DokuWiki that it shouldn't parse a particular file, but just add it to the CSS output as-is?

@Celti
Copy link

Celti commented Feb 23, 2018

I am having a similar issue with lessphp choking on CSS named grid lines in leafo/lessphp#637, and would appreciate a workaround.

Alternatively, there is oyejorge/less.php which appears to be much more actively maintained, and has a drop-in replacement shim for lessphp. ETA: though as it turns out, that one has a different bug in the handling of my CSS code: oyejorge/less.php#359

@iainhallam
Copy link
Contributor Author

I am having a similar issue with lessphp choking on CSS named grid lines in leafo/lessphp#637, and would appreciate a workaround.

@Celti, my workaround is to include the Bulma CSS from a link element in the top of my template main.php, rather than letting DokuWiki handle it.

@micgro42
Copy link
Collaborator

@Celti In the master branch, we are actually using a fork of leafo/lessphp: MarcusSchwarz/lesserphp. However, that ceased to see any activity just after we switched to it :/
Switching to oyejorge/less.php was discussed, unfortunately there are licensing issues preventing this, see #1153

@gamma
Copy link
Contributor

gamma commented Feb 28, 2018

I think what might help is to separate less and css styles in css.php. AFAIK it currently puts both, .css and .less files together and then runs the lessphp functions over it.

It would be better to handle less and css separately and merge them after processing has finished.

@Michaelsy
Copy link
Contributor

Michaelsy commented May 5, 2018

A trick to insert (nearly) every unparsed code in LESSPHP

@test-value: "1234";

div {
    color: red;
    dummy: e("0; @test-value A trick to insert every unparsed code #!§$%&/()=?#; dummy: 0");
    margin: 10px;
    value: @test-value;
    value: e(@test-value);
}    

compiles to this "CSS-code":

div {
  color: red;
  dummy: 0; @test-value A trick to insert every unparsed code #!§$%&/()=?#; dummy: 0;
  margin: 10px;
  value: "1234";
  value: 1234;
}

Manual reference: http://leafo.net/lessphp/docs/#string_unquoting

Online-compiling for testing: http://leafo.net/lessphp/editor.html

DokuWiki Manual: LESS CSS Support

Michael Sy.


Edit (only 2 years later...):

A method with milder means, but not quite as extensive possibilities:

#dokuwiki__site {
    width: 98%;   /* Fallback for older browsers */
    width: ~"calc(100% - 44px)";
} 

compiles to this CSS-code:

#dokuwiki__site {
  width: 98%;
  width: calc(100% - 44px);
}

Application see: DokuWiki Forum
References: see above in this post.

@Rainbow-Spike
Copy link
Contributor

~"screen CSS code from LESS parser"

@desbest
Copy link

desbest commented Jan 22, 2021

Is there a way to do string unquoting for a string that takes up multiple lines?

Example CSS

background:
     url('images/@{imagetheme}/listingback-top2.png') repeat-x,
 	 linear-gradient(transparent,rgba(0,0,0,0.03)) 0 0/100% 16px,
     linear-gradient(@blockygradientstartcolour,@blockygradientendcolour)
    ;

@Michaelsy
Copy link
Contributor

Is there a way to do string unquoting for a string that takes up multiple lines?

See the solution here, at the position "Edit II".

- Michael Sy.

@Michaelsy
Copy link
Contributor

See also: #3735 (comment)

- Michael Sy.

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

No branches or pull requests

7 participants