ThemeFuse / Unyson

A WordPress framework that facilitates the development of WP themes
http://unyson.io
922 stars 217 forks source link

Styling Customisation, 'before', 'after' and Predefined Styles #508

Closed splendidbob closed 9 years ago

splendidbob commented 9 years ago

Hi,

Thanks for the great framework. Very impressive work.

I am struggling a little with the styling extension however. What I want to do is add my own options to the default options.

It seems I can add new options inside 'before' and 'after', such as:

'before' => array( 'menu_border' => array( 'label' => __('Menu Border', 'fw'), 'desc' => false, 'type' => 'color-picker', 'value' => '#cccccc', ) ),

However, whist this is useful, I really need to be able to set this in the predefined file (/includes/predefined-styles.php) so that this option can also be assigned via the colour presets.

I attempted to add this into predefined-style.php, but couldn't get it to work (this hasn't been done in the scratch theme, so not sure if it is possible).

Prob is though, Its important these custom styles get into the colour schemes, I have some elements such as buttons which need to be built into the colour schemes.

So my questions,

1)Is there a way to insert the custom options placed in before / after into the predefined-styles.php page (if so would it be possible to demonstrate how?)

2)Failing this, is there any possibility of overwriting the default options?

The docs say 'The options that appear on the customization page are located in the extension’s directory /options/settings.php and can be overwritten by copying the file to framework-customizations/extensions/styling/options/settings.php in the child theme.' - I couldn't find this settings.php file, or options folder (if this is referring to what I want to do in 2) in framework / extensions / styling ).

I might have missed something obvious though (tired atm ;)).

valeriuzdrobau commented 9 years ago

Hi, sorry for the delay

  1. No, unfortunately not possible.
  2. Yes, it can be rewritten. The file is now called framework-customizations/extensions/styling/options/appearance-settings.php. I corrected documentation.
valeriuzdrobau commented 9 years ago

Copy the file appearance-settings.php from scratch theme.

splendidbob commented 9 years ago

Hi, thanks for your reply.

Yep, had found the appearance-settings.php. It doesn't appear from this though that you can change the actual elements, only add new sections. i.e. there are 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'links', 'links_hover', 'background' allowed in each section, and these cannot possibly be modified (or added to), only optionally omitted. Sure, I can add more elements with the before and after, but then these elements wont appear in the colour presets.

For example, in my dropdown I have the visible top level links on a white background, the sub links / mega menu etc have a black background, so a single 'links' option isn't enough (I need links, links_hover, sub_links, sub_links_hover.

I am probably going to have to create numerous sections, for example, create 'menu' and 'submenu' sections so I can create elements for both links. I can probably just about get it to work this way, though its going to be a little bit cumbersome for the user.

Perhaps a feature request I guess ;)

Thanks

splendidbob commented 9 years ago

Hmm, I am struggling with this tbh. Without a way to add new elements (that can be pre-styled with each scheme) this extension seems only useful for fairly basic themes.

For example, it (seems) impossible to create styles within the styling extension for:

Button background colour, button background hover colour, border colours, menu sub links, menu hover background colour and so on.

You can create these of course, using the before and after options, but because you can't pre-set the styles for these, they won't change when the user changes the colour scheme. This is going to only change some of the visuals when the user tries to switch schemes.

Or am I missing something? Is there some way to add new elements other than 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'links', 'links_hover', 'background' that can be prestyled for each color scheme? Using appearance-settings I can only add more sections (and optionally not include some of these elements).

Thanks.

valeriuzdrobau commented 9 years ago

There are no opportunity to expand the list: 'h1', '2', '3', '4', '5', '6', 'p', 'links', 'links_hover', 'background'. We no longer expand styling extension because now working on the possibility of using our options in Customizer. Please wait to launch this option, you can follow this issue.

splendidbob commented 9 years ago

Ok, thanks, yes this makes sense. I will hold off on this for now until I know whats happening there :)

Cheers.

thanhluu commented 9 years ago

Is there any new on this issue?

llemurya commented 9 years ago

@thanhluu the styling extension will be deprecated please use the options in customizer, for more information read about options in customizer.