Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

feat: add support for styling widgets #107

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

arjunlalb
Copy link
Contributor

@arjunlalb arjunlalb commented Aug 25, 2020

Dark widget

Screenshot 2020-08-25 at 5 45 21 PM

@arjunlalb arjunlalb requested a review from a team as a code owner August 25, 2020 12:16
@codecov
Copy link

codecov bot commented Aug 25, 2020

Codecov Report

Merging #107 into main will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #107      +/-   ##
==========================================
+ Coverage   85.91%   85.93%   +0.01%     
==========================================
  Files         389      390       +1     
  Lines        6917     6923       +6     
  Branches      850      809      -41     
==========================================
+ Hits         5943     5949       +6     
- Misses        961      963       +2     
+ Partials       13       11       -2     
Impacted Files Coverage Δ
...ntainer/layout/auto/auto-container-layout.model.ts 31.81% <ø> (ø)
...ets/container/layout/container-layout.component.ts 50.00% <ø> (ø)
...ner/layout/custom/custom-container-layout.model.ts 42.85% <ø> (ø)
...s/src/widgets/container/layout/container-layout.ts 52.94% <100.00%> (+10.08%) ⬆️
...oards/src/widgets/container/layout/widget-theme.ts 100.00% <100.00%> (ø)
...pover/position-strategy/mouse-position-strategy.ts 9.67% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4715ec1...465ea97. Read the comment docs.

@@ -41,6 +41,7 @@ export class AutoContainerLayoutModel extends ContainerLayout {
columns: `repeat(${gridDimension[1]}, minmax(${this.minColumnWidth}px, 1fr))`,
gap: `${this.gridGap}`,
enableStyle: this.enableStyle,
widgetTheme: this.widgetTheme,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm super hesitant to add theme to our existing model considering it's already built in (but not fleshed out). @arjunlalb I'm guessing you were unaware of it, so do you mind looking into that first and seeing if we could accomplish the same thing with that system?

Some pointers:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aah. You're right. I wasn't aware of it. Will take a look.

Is that a theme system for the whole app or usable for just isolated usecases?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use it isolated but it's meant to integrate with the broader app. Specifically two aspects to watch out for:

  • Themes are inherited. If you theme a container, then any of its children will inherit that theme by default. They're also merged.
  • Using a theme is opt in for the renderer. Because different widgets will apply styles differently, they need to explicitly apply theme values.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants