Skip to content

Commit

Permalink
Move Dashboard theme definitions to the components package
Browse files Browse the repository at this point in the history
Make the `tkn--theme-*` classes available to consumers via the
common styles in the `@tektoncd/dashboard-components` package.

This means consumers do not need to define the themes themselves
unless they want to override the defaults.
  • Loading branch information
AlanGreene committed Sep 2, 2024
1 parent dc6e902 commit c986bad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
19 changes: 19 additions & 0 deletions packages/components/src/scss/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,27 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

@use '@carbon/react/scss/themes';
@use '@carbon/react/scss/theme' as *;

:root, .tkn--theme-light {
@include theme(themes.$g10);
}

@mixin tkn--theme-dark {
@include theme(themes.$g90);
}

.tkn--theme-dark {
@include tkn--theme-dark;
}

@media (prefers-color-scheme: dark) {
.tkn--theme-system {
@include tkn--theme-dark;
}
}

.tkn--tooltip-trigger {
appearance: none;
padding: 0;
Expand Down
18 changes: 0 additions & 18 deletions src/scss/_carbon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,6 @@ limitations under the License.
--tkn-button-border-width: #{button.$button-border-width};
}

:root, .tkn--theme-light {
@include theme.theme(themes.$g10);
}

@mixin tkn--theme-dark {
@include theme.theme(themes.$g90);
}

.tkn--theme-dark {
@include tkn--theme-dark;
}

@media (prefers-color-scheme: dark) {
.tkn--theme-system {
@include tkn--theme-dark;
}
}

.#{config.$prefix}--actionable-notification,
.#{config.$prefix}--actionable-notification--toast,
.#{config.$prefix}--inline-notification {
Expand Down

0 comments on commit c986bad

Please sign in to comment.