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

return ValueList from separate method to be able to inject custom values #3031

Merged
merged 1 commit into from
Oct 26, 2015
Merged

return ValueList from separate method to be able to inject custom values #3031

merged 1 commit into from
Oct 26, 2015

Conversation

Remo
Copy link
Contributor

@Remo Remo commented Oct 16, 2015

By extracting this part of the method we can easily override the result of ValueList in our page theme controller. This would offer the possibility to add custom values from our PHP code.

Creating a variable my-color would work with this:

    public function getThemeCustomStyleObjectValues()
    {
        $valueList = parent::getThemeCustomStyleObjectValues();

        $myColor = new \Concrete\Core\StyleCustomizer\Style\Value\ColorValue('my');
        $myColor->setAlpha(0.5);
        $myColor->setRed(111);
        $myColor->setBlue(222);
        $myColor->setGreen(33);

        $valueList->addValue($myColor);

        return $valueList;
    }

@myconcretelab
Copy link
Contributor

This seems to be a great and very compatible way with future improvement.
The only limitation is ta have four lines to change a color.
I would be happy to see this merged !

@Remo
Copy link
Contributor Author

Remo commented Oct 16, 2015

yeah, you'd need more code, but using LESS is wrong as we might have/want to support SCSS, PostCSS in the future in which case this should be the better approach. We could create more constructors to be able to specify the colour values in one line. That doesn't concern me much at this point.

@myconcretelab
Copy link
Contributor

I completely agree ! You don't know how i'm happy ! Thank you.
Read that SASS will be integrated is another great news !!

aembler added a commit that referenced this pull request Oct 26, 2015
return ValueList from separate method to be able to inject custom values
@aembler aembler merged commit 11240f5 into concretecms:develop Oct 26, 2015
@myconcretelab
Copy link
Contributor

I'm sorry i'm a bit new to Github but i don't understand why this merge is not in the new 5.7.5.3 ?

@Remo Remo deleted the feature/theme-variable-injection branch November 26, 2015 07:55
@Remo
Copy link
Contributor Author

Remo commented Nov 30, 2015

because it was only merged into develop and not into release/5.7.5.3
Check this: https://github.com/concrete5/concrete5/tree/release/5.7.5.3

This branch is 230 commits behind develop.

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

Successfully merging this pull request may close these issues.

3 participants