htmlText and CSS

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

Locked
monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

htmlText and CSS

Post by monte » Mon Jun 17, 2013 10:27 pm

While I think implementing CSS is a little pointless if we will eventually have a proper browser control it might be nice to be able to set the styles of h1-6 and blockquote... maybe strong and em too. At first glance this doesn't look overly complicated... If we had a multi-dimensional array keyed on tag with textStyle, textColor and textFont keys we could use that instead of the default styles for these things...

Syntax idea:

Code: Select all

set the htmlStyles of fld X to theArray
I haven't thought about inheritance yet which may complicate things... setting the htmlStyles for a stack... leaving some empty... that kind of thing
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: htmlText and CSS

Post by monte » Tue Jun 18, 2013 5:40 am

More thoughts on this... it would be fairly complicated to have fields update when you set the htmlStyles.. but fairly easy if the htmlStyles only applies to subsequent settings of the htmlText... I was thinking the latter... If the former you would need to work out if the style of a run matches one of those tags then change it... If we could work that out then perhaps the htmlText could return those tags rather than what they are translated to...

The idea that we could use the inheritance path and styles applied to these tags to change lots of fields in one hit is enticing...

Hmm... it might also be interesting to have a single property on a field that set it's styling to make use of the separate inheritance paths for plain text, h1, h2 etc without having to use htmlText...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Locked

Return to “Engine Contributors”