Skip to content

Change themed CSS generation to SCSS templates #2288

Description

@eppfel

Thanks to the introduction of Sass in nextcloud (#2050), we could really improve how the css styles are generated in the Theming Controller, because now the controller is bloated with concatenated CSS strings: server/apps/theming/lib/Controller/ThemingController.php

We could use the scssphp compiler to compile SASS templates with variables:

echo $scss->compile('
  $color: #abc;
  div { color: lighten($color, 20%); }
');

This would also make theming more accessible.
What do you think @juliushaertl, @LukasReschke, @schiessle @nickvergessen ?

Activity

  1. juliusknorr commented on Nov 23, 2016

    @juliusknorr
    Member

    @eppfel Having a simpler CSS generation really makes sense.

    We should have the CSS rules in an external file and generate the CSS by just adding the theming variables.

    I'm not that familliar with SCSS but i guess conditional statements depending on a variable value are also possible, right?

  2. eppfel commented on Nov 23, 2016

    @eppfel
    MemberAuthor

    jep, there is a lot of functionality: http://www.sass-lang.com/documentation/file.SASS_REFERENCE.html#control_directives__expressions

    And yes external file template was, what i was thinking of.
    I'd gladly try to build something on top of #2050, but not before the weekend.

  3. juliusknorr commented on Nov 25, 2016

    @juliusknorr
    Member

    @eppfel Sure, that would be awesome. If you need any help, just ping me. 😉

  4. eppfel commented on Dec 1, 2016

    @eppfel
    MemberAuthor

    I was thinking...
    When we move to SASS we actually could give up on the practice, of overwriting styles with an additional theming stylesheet and move the variables (which are mainly just colors) to the original SASS files.
    Less files to load, less CSS rules to apply, much happy 👏
    Of course this implies more theming code in the core. I don't know if this is desired 🤔
    Starting development does not make sense, yet, as #2050 is still being developed.

  5. added
    1. to developAccepted and waiting to be taken care of
    and removed
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Dec 1, 2016
  6. added this to the Nextcloud 12.0 milestone on Dec 1, 2016
  7. self-assigned this
    on Jan 21, 2017
  8. added and removed
    1. to developAccepted and waiting to be taken care of
    on Jan 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions