These are chat archives for adaptlearning/theming

17th
Feb 2016
Tom Taylor
@taylortom
Feb 17 2016 09:32
Hello, thought there may be need for this
Guy Willis
@guywillis
Feb 17 2016 09:32
Hello :)
Brian Quinn
@brian-learningpool
Feb 17 2016 09:32
hi
lc-thomasberger
@lc-thomasberger
Feb 17 2016 09:33
hello
Tom Taylor
@taylortom
Feb 17 2016 09:34
for discussion relating to adaptlearning/adapt_framework#954
:)
I'd like to see if we could finally get theme 'extensions' in
i.e. a way to add 'patches' to an existing theme
Brian Quinn
@brian-learningpool
Feb 17 2016 09:38
hey Tom, i don't really follow...
Tom Taylor
@taylortom
Feb 17 2016 09:38
it's outside of the scope of this issue, but something I've wanted to be able to do from the start :)
basically, I'd like to be able to create a child theme of vanilla for example
Brian Quinn
@brian-learningpool
Feb 17 2016 09:39
ah
Tom Taylor
@taylortom
Feb 17 2016 09:39
and only specify a list of variable overrides
Brian Quinn
@brian-learningpool
Feb 17 2016 09:39
like wordpress child themes?
Tom Taylor
@taylortom
Feb 17 2016 09:39
or whatever
yeah exactly
Brian Quinn
@brian-learningpool
Feb 17 2016 09:39
that'd be really useful
Tom Taylor
@taylortom
Feb 17 2016 09:40
I really can't be bothered to do a whole theme, but would like to be able to change a few things
think it would open up theming to a lot more people
Brian Quinn
@brian-learningpool
Feb 17 2016 09:40
it certainly would
maybe vanilla takes them 80% of the way
Tom Taylor
@taylortom
Feb 17 2016 09:40
yeah, exactly
hopefully would also get a few more themes out there for other people to use too
Going back to ollie's PR, I think we need to maybe look at what variables are core, and what are theme-specific (I haven't been through his changes thoroughly enough to know what's been carried into core)
so that this kind of theming is as easy as possible
I think the main thing for me is the annoying missing variable errors
Tom Taylor
@taylortom
Feb 17 2016 09:49

My thinking so far is a hierarchy like core less -> plugin less -> theme less:

  • Core defines (as minimally as possible) a list of plugin-independent variables
  • No plugins should reference variables not defined in core, or its own LESS
  • Themes are free to contain as many new variables as they like

So this ultimately means that the core can be built without a theme (or with any theme), regardless of what plugins are installed

Brian Quinn
@brian-learningpool
Feb 17 2016 09:52
i think that makes perfect sense
i haven't had a chance to check out Ollie's PR yet either though
Tom Taylor
@taylortom
Feb 17 2016 09:53
I think that's pretty much what it does
lc-thomasberger
@lc-thomasberger
Feb 17 2016 10:04
I like the idea.
Oliver Foster
@oliverfoster
Feb 17 2016 10:05
all i've done is moved the templates, fonts and the main less variable declarations and responsive stuff into code @brian-learningpool ... oh and changed the default colours to all grey
lc-thomasberger
@lc-thomasberger
Feb 17 2016 10:05
Multiple themes means also small atomic theme fragements?
eg: sub-theme to add images to articles/blocks or to apply font-styles to all the text
Tom Taylor
@taylortom
Feb 17 2016 10:06
yeah, I think that's the final step
and making sure we get core variables is key to this
to try and make these sub-themes as compatible with each other as possible
Oliver Foster
@oliverfoster
Feb 17 2016 10:07
blob
Tom Taylor
@taylortom
Feb 17 2016 10:07
ooh I like it actually
very minimal :D
Oliver Foster
@oliverfoster
Feb 17 2016 10:08
blob
so far it has worked nicely in highlighting some padding oddities in the hotgraphic popup buttons and for working out the trickle refactor. it seems easier to concentrate on the behaviour without the noise of the styling.
lc-thomasberger
@lc-thomasberger
Feb 17 2016 10:15
during the theme rebuild for version 2 we structured the variables like this:
adapt-default.less <-- contains all the old variables left for compatibility to old plugins
added in Version 2, introducing new variables not all available in core
colors.less
fonts.less
generic.less
padding.less
Oliver Foster
@oliverfoster
Feb 17 2016 10:16
all of those are in core with that pr, as well as src/fonts.less and src/icons.less
blob
i'm a little suprised at how good it looks...
lc-thomasberger
@lc-thomasberger
Feb 17 2016 10:18
is it responsive?
Oliver Foster
@oliverfoster
Feb 17 2016 10:19
yup
lc-thomasberger
@lc-thomasberger
Feb 17 2016 10:20
with a nice wrapper :smile:
so what are the next actions?
Oliver Foster
@oliverfoster
Feb 17 2016 10:20
simplify the core less
removing the color declarations is the first good step
as @tomgreenfield suggested
and i'm not sure about the @primary, @secondary etc
sounds like a good theme abstraction
but not so good in the core
ultimately it depends what it breaks
Oliver Foster
@oliverfoster
Feb 17 2016 10:39
@lc-thomasberger have you got any thoughts on how to structure the core bit?
@/all any objections to including templates, fonts, assets and more less in the core?
lc-thomasberger
@lc-thomasberger
Feb 17 2016 10:42
not at the moment, I think we should write down some specification. Define how the the subtheme should fit together.
Oliver Foster
@oliverfoster
Feb 17 2016 10:43
cool, i think as few abstractions as possible would be good
lc-thomasberger
@lc-thomasberger
Feb 17 2016 10:44
not sure about that
for instance, if we have a sub-theme that only applies a color swatch to the theme. how will it overwrite the core theme?
if we keep the primary, secondary, ... colors this is easy
Oliver Foster
@oliverfoster
Feb 17 2016 10:45
if we make core only the simplest foundation required to layer up additional abstractions, the themes can handle that
lc-thomasberger
@lc-thomasberger
Feb 17 2016 10:46
yes, but then the sub-themes might become huge and add probably duplicate styling
we must spend a fair amount of thinking and testing with possible sub-theme scenarios i guess
Oliver Foster
@oliverfoster
Feb 17 2016 10:47
yea, and figure out which common parts are left
those are the core bits
shall we leave that pr as it is until you've had a play around over the next few days/weeks/months?
there's no rush
the principle still seems quite sound
lc-thomasberger
@lc-thomasberger
Feb 17 2016 10:55
ahm yes please. I think it is not a good idea to rush. Will try to play around with it and try a couple of things.
can i add subthemes already?
Oliver Foster
@oliverfoster
Feb 17 2016 10:56
you should be able to include multiple themes at the moment, but i'm not sure how the theme.json will work
let me know if you get build errors and i'll look into it
or if it just doesn't work
lc-thomasberger
@lc-thomasberger
Feb 17 2016 11:00
:thumbsup: