Skip to content

Commit

Permalink
feat(tilelayout): add styles to Fluent
Browse files Browse the repository at this point in the history
  • Loading branch information
magdalenaan authored and TeyaVes committed Aug 26, 2022
1 parent a9f4367 commit cb8aeee
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/fluent/scss/card/_layout.scss
Expand Up @@ -56,6 +56,8 @@
// Card title
.k-card-title {
@extend .k-h5;
font-weight: var( --kendo-card-title-font-weight, #{$kendo-card-title-font-weight} );
margin-block-end: var( --kendo-card-title-margin-bottom, #{$kendo-card-title-margin-bottom} );
}


Expand All @@ -67,6 +69,9 @@

// Header
.k-card-header {
@extend .k-h5;
font-weight: var( --kendo-card-title-font-weight, #{$kendo-card-title-font-weight} );
margin: 0;
padding-inline: var( --kendo-card-header-padding-x, #{$kendo-card-header-padding-x} );
padding-block: var( --kendo-card-header-padding-y, #{$kendo-card-header-padding-y} );
border-width: 0 0 var( --kendo-card-header-border-width, #{$kendo-card-header-border-width} );
Expand Down
6 changes: 6 additions & 0 deletions packages/fluent/scss/card/_variables.scss
Expand Up @@ -54,6 +54,9 @@ $kendo-card-focus-border: var( --kendo-component-border, initial ) !default;
/// @group card
$kendo-card-focus-shadow: var( --kendo-box-shadow-depth-4, none ) !default;

/// Text weight of the card header.
/// @group card
$kendo-card-header-font-weight: var( --kendo-font-weight, initial ) !default;
/// Horizontal padding of the card header.
/// @group card
$kendo-card-header-padding-x: map-get( $kendo-spacing, 3 ) !default;
Expand Down Expand Up @@ -99,6 +102,9 @@ $kendo-card-footer-text: inherit !default; // $header-text
/// @group card
$kendo-card-footer-border: inherit !default; // $header-border

/// Text weight of the card title.
/// @group card
$kendo-card-title-font-weight: $kendo-card-header-font-weight !default;
/// Bottom margin of the card title.
/// @group card
$kendo-card-title-margin-bottom: map-get( $kendo-spacing, 3 ) !default;
Expand Down
4 changes: 2 additions & 2 deletions packages/fluent/scss/index.scss
Expand Up @@ -119,7 +119,7 @@
@use "expansion-panel";
@use "panelbar";
// @use "splitter";
// @use "tilelayout";
@use "tilelayout";


// Data management
Expand Down Expand Up @@ -281,7 +281,7 @@
@include expansion-panel.styles();
@include panelbar.styles();
// @include splitter.styles();
// @include tilelayout.styles();
@include tilelayout.styles();


// Data management
Expand Down
39 changes: 39 additions & 0 deletions packages/fluent/scss/tilelayout/_layout.scss
@@ -0,0 +1,39 @@
@use "../core" as *;
@use "_variables.scss" as *;

@mixin kendo-tilelayout--layout() {

.k-tilelayout {
border-width: var( --kendo-tilelayout-border-width, #{$kendo-tilelayout-border-width} );
border-style: solid;
box-sizing: border-box;
outline: 0;
display: grid;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: $rgba-transparent;
}

.k-tilelayout-item {
position: relative;
z-index: 0;
}

.k-layout-item-hint {
@include border-radius( var( --kendo-tilelayout-hint-border-radius, #{$kendo-tilelayout-hint-border-radius} ) );
border-width: var( --kendo-tilelayout-hint-border-width, #{$kendo-tilelayout-hint-border-width} );
border-style: solid;
position: relative;

&.k-layout-item-hint-resize {
z-index: 3;
}
}

.k-tilelayout-item-header.k-card-header {
z-index: 0;
}

.k-tilelayout-item-body {
min-height: 0;
}
}
18 changes: 18 additions & 0 deletions packages/fluent/scss/tilelayout/_theme.scss
@@ -0,0 +1,18 @@
@use "../core/mixins" as *;
@use "_variables.scss" as *;

@mixin kendo-tilelayout--theme() {

.k-tilelayout {
@include fill(
$bg: var( --kendo-tilelayout-bg, #{$kendo-tilelayout-bg} )
);
}

.k-layout-item-hint {
@include fill(
$bg: var( --kendo-tilelayout-hint-bg, #{$kendo-tilelayout-hint-bg} ),
$border: var( --kendo-tilelayout-hint-border, #{$kendo-tilelayout-hint-border} )
);
}
}
24 changes: 24 additions & 0 deletions packages/fluent/scss/tilelayout/_variables.scss
@@ -0,0 +1,24 @@
@use "../core/" as *;
@use "../core/color-system" as *;
@use "../card/_variables.scss" as *;
@use "sass:color";

/// Width of the border around the tilelayout.
/// @group tilelayout
$kendo-tilelayout-border-width: 0px !default;
/// Background color of the tilelayout.
/// @group tilelayout
$kendo-tilelayout-bg: get-theme-color-var( neutral-10 ) !default;

/// Width of the border around the tilelayout hint.
/// @group tilelayout
$kendo-tilelayout-hint-border-width: 1px !default;
/// Color of the border around the tilelayout hint.
/// @group tilelayout
$kendo-tilelayout-hint-border: var( --kendo-component-border, initial ) !default;
/// Radius of the border around the tilelayout hint.
/// @group tilelayout
$kendo-tilelayout-hint-border-radius: var( --kendo-border-radius-lg, initial ) !default;
/// Background color of the tilelayout hint.
/// @group tilelayout
$kendo-tilelayout-hint-bg: rgba(255, 255, 255, .2) !default;
25 changes: 25 additions & 0 deletions packages/fluent/scss/tilelayout/index.scss
@@ -0,0 +1,25 @@
// Module meta
$_kendo-module-meta: (
name: "tilelayout",
dependencies: (
"card"
)
);


// Component
@forward "_variables.scss";
@use "_layout.scss" as *;
@use "_theme.scss" as *;

// Register
@use "../core/module-system/" as module;
@include module.register( $_kendo-module-meta... );

// Expose
@mixin styles() {
@include module.render( "tilelayout" ) {
@include kendo-tilelayout--layout();
@include kendo-tilelayout--theme();
}
}

0 comments on commit cb8aeee

Please sign in to comment.