Element Library

Re: Rendering - theme customisation with PHP

by Damyon Wiese -
Number of replies: 6
Tims suggestion of using php classes with __toString() methods so that they are only evaluated if they are used in the template solves this issue - what I was asking before was if Tim was expecting the same "lazy" evaluation to occur in the javascript which would require a standard way of sending an object from php to javascript with enough info that the javascript could callback to the php if the data was needed. This would be complex and slow because of the increased number of ajax callbacks - so I'm glad we do not need to explore this path any further.

In reply to Damyon Wiese

Re: Rendering - theme customisation with PHP

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi all,

With Bootstrap now going to SASS, I am concerned that in reading https://docs.moodle.org/dev/Element_HTML_and_CSS_guidelines#CSS_for_elements that the 'less' folder is restrictive to a technology rather than a concept.  All other folders are generic concepts not dependant on the technology contained within, so therefore the 'less' folder is odd and enforcing a rule that prevents progress / alternative frameworks.  Therefore it would be better for this folder to be called and referenced as 'style_src' or 'src' etc.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Rendering - theme customisation with PHP

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

What makes you think SASS will stay the same? Same with GRUNT and all the other odd named bits and bobs that pop up all over the web?

 

In reply to Gareth J Barnard

Re: Rendering - theme customisation with PHP

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Just been doing a quick read of the SASS concept and found it totally mystifying. I am not sure I am in agreement with your logic about the difference between SASS and LESS. As I see it they are both pretty much the same and both just as reliant on Technology to compose the end result - a stylesheet.

 

In reply to Mary Evans

Re: Rendering - theme customisation with PHP

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mary,

To be honest I think you are missing the point.  I'm not saying that SASS or GRUNT or anything will stay the same.  I am saying that the folder names should be technology implementation independent.  All the folder names bar 'less' are, and that is inconsistent and inflexible when 'standards' are enforced upon them.

Gareth

In reply to Gareth J Barnard

Re: Rendering - theme customisation with PHP

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

So, where /style contains css files, /style_src would contain LESS or SASS (or any other technology that gets compiled to create the CSS), rather than having a LESS folder, a separate SASS folder and potentially not being able to handle (or at least being potentially confusing to handle) other future technologies because of the folder being specificaly referenced.

In reply to Gareth J Barnard

Re: Rendering - theme customisation with PHP

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Do you mean like 'src' and 'build' in Javascript?