Skip to content

Publish styles as separate scss files to allow for easy customization  #248

Closed

Description

@beeman

In the current version of this library, the styles are part of SplitComponent.

While this is great for a usability point of view (no need to include a separate style) it limits the flexibility.

To offer a greater flexibility to developers using this library, it makes sense to publish the styles as separate SCSS files.

Pros

  • makes it easier to extend/override the styles.
  • publishing it as SCSS allows for using variables, making it easy to tweak appearance.
  • we can provide with various styles out of the box (dark/light).

Cons

  • Installation takes 1 more step as the user has to include the style.

TODO

  • pull out styles into separate file, making sure it still works.
  • add SCSS variables for colors.
  • get rid of any ng-deep, where possible.

Activity

  1. added this to the v6 milestone on Jul 23, 2020
  2. Harpush commented on Dec 3, 2022

    @Harpush
    Collaborator

    @beeman I have an idea how to tackle it... Let me know your opinion and if anything is missing:

    1. SCSS theme globally:
    @use 'angular-splitter/theme' as split;
    
    @include split.core();
    @include split.theme((
      gutter-background-color: #eeeeee
      // More here?
    ));
    1. Specific CSS variables overriding:
    --as-split-gutter-background-color: #eeeeee;
    // More here?
    1. Allowing custom icons as template (Related to Feature: Gutter with arrow icons to move either left/right or top/bottom with one click. #163, Allow Content Projection inside the gutter. #227, [Feature request]: support custom icon #266):
    <as-split ...>
      <div *asSplitGutterIcon>...</div>
      ...
    </as-split>

    The asSplitGutterIcon context will be:

    interface SplitGutterIconTemplateContext {
      areaBefore: IArea
      areaAfter: IArea
      index: number
    }

    All that's missing is knowing programmatically (if needed) when a gutter is being dragged through asSplitGutterIcon context as currently it is only in the "css land".

    Will also solve:
    #331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions