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

feat: expose createTheme as createCartoTheme #138

Closed
wants to merge 2 commits into from

Conversation

AdriSolid
Copy link
Contributor

@AdriSolid AdriSolid commented Apr 8, 2021

Expose cartoTheme as createCartoTheme.

Related with documentation: CartoDB/documentation#78

@AdriSolid AdriSolid requested a review from VictorVelarde April 8, 2021 10:28
@coveralls
Copy link
Collaborator

coveralls commented Apr 8, 2021

Pull Request Test Coverage Report for Build 729750896

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 79.336%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/react-ui/src/theme/carto-theme.js 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
packages/react-ui/src/theme/carto-theme.js 1 72.73%
Totals Coverage Status
Change from base Build 680506927: 0.2%
Covered Lines: 547
Relevant Lines: 655

💛 - Coveralls

@@ -1175,16 +1175,10 @@ export const cartoThemeOptions = {
}
};

export function createTheme(options = {}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure we can remove default options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As described in documentation PR, the way to overwrite cartoThemeOptions is equal for both implementations in this way.

Also, passing to createTheme and object like:

const mainColor = { palette: { primary: { main: '#80000' }}}

results in an error. Do you have any other idea to handle this?

Copy link
Contributor

Choose a reason for hiding this comment

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

What if we leave the optional param, and just expose the method?

That way we could also allow overriding certain properties, so we would eventually get 3 options for the user:

  • call to createTheme without params (one line from the client)
  • call to createTheme with certain options (maybe just colors)
  • completely custom case, using just cartoThemeOptions (what is currently being used from template)

/cc @borja-munoz

@VictorVelarde
Copy link
Contributor

Please add a note to changelog and link here the PR with the doc change

@VictorVelarde
Copy link
Contributor

We should talk more about this one with @borja-munoz, before exposing it

@VictorVelarde
Copy link
Contributor

Not a clear advantage on the change, so I'm closing this

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

Successfully merging this pull request may close these issues.

3 participants