Giter Site home page Giter Site logo

Comments (6)

driskull avatar driskull commented on May 27, 2024

@asangma global style: globalStyle: "src/assets/styles/includes.scss",

from calcite-app-components.

asangma avatar asangma commented on May 27, 2024

Thanks @driskull!

from calcite-app-components.

driskull avatar driskull commented on May 27, 2024

I think this is pretty much how we want to do theming:
https://stackoverflow.com/questions/52624110/can-stenciljs-component-use-external-theming?answertab=votes#tab-top

Using CSS properties (variables)

http://jsfiddle.net/5fv9r6e1/

from calcite-app-components.

asangma avatar asangma commented on May 27, 2024

Looks like I have something working nicely here:
css-var-themes


:root {
  // Background
  --background: #{$white};
  --background__content: #{$lightest-gray};

  // :hover :active :current
  --background--highlight: #{$lightest-blue};

  // Foreground
  --foreground: #{$darker-gray};
  --foreground__interactive: #{$darker-gray};

  // Foreground :states
  --foreground__interactive--highlight: #{$dark-blue};

  // Borders
  --border: #{rgba($darker-gray, 0.25)};
}

:root([theme="dark"]) {
  // Background
  --background: #{$darker-gray};
  --background-content: #{$darkest-gray};

  // Background :hover :active :current
  --background--highlight: #{$darkest-gray};

  // Foreground
  --foreground: #{$lightest-gray};
  --foreground__interactive: #{$lighter-gray};

  // Foreground  :hover :active :current
  --foreground__interactive--highlight: #{$v-bb-120}; // Vibrant Blue

  // Borders
  --border: #{rgba($lightest-gray, 0.25)};
}

And in e.g. calcite-action

:host .calcite-action__button {
...
  color: var(--foreground__interactive);
  fill: var(--foreground__interactive);
  background-color: var(--background);
...
}

from calcite-app-components.

driskull avatar driskull commented on May 27, 2024

related to: Esri/calcite-design-system#39 & #50

https://teams.microsoft.com/l/message/19:[email protected]/1561067229595?tenantId=aee6e3c9-711e-4c7c-bd27-04f2307db20d&groupId=56fae21a-9407-4943-859f-a9bfcf0bbad3&parentMessageId=1561067229595&teamName=Calcite&channelName=Calcite%20Components&createdTime=1561067229595

from calcite-app-components.

driskull avatar driskull commented on May 27, 2024

Here is what Calcite is proposing for handling theming. Esri/calcite-design-system#66

'@stencil/state-tunnel'
https://github.com/ionic-team/stencil-state-tunnel
https://github.com/ionic-team/stencil-state-tunnel/wiki

from calcite-app-components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.