Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/motion/__tests__/motion-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,24 @@ describe('@carbon/motion', () => {
).rejects.toThrow(
/Unable to find duration `slo-01` for the custom surface/
);

await expect(
render(`
@use '../index.scss' as motion;

.surface {
@include motion.surface((
kind: reveal,
enter: (opacity: 1),
exit: (opacity: 0),
enter-easing: (name: entrance, mode: expressive),
exit-easing: (name: exit, mode: expressive),
));
}
`)
).rejects.toThrow(
/Unable to find duration `nothing` for the custom surface/
);
});

test('surface mixin rejects a malformed inline definition', async () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/motion/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ $-durations: (
}

@if $kind != 'reveal' {
@error 'Expected the #{$label} to declare `kind: reveal`, but found `#{if($kind, $kind, 'nothing')}`.';
@error 'Expected the #{$label} to declare `kind: reveal`, but found `#{$kind or 'nothing'}`.';
}

@each $key in (enter, exit) {
Expand All @@ -178,7 +178,7 @@ $-durations: (
$duration: map.get($definition, duration);

@if not map.has-key($-durations, $duration) {
@error 'Unable to find duration `#{if($duration, $duration, 'nothing')}` for the #{$label}. Expected one of: #{map.keys($-durations)}.';
@error 'Unable to find duration `#{$duration or 'nothing'}` for the #{$label}. Expected one of: #{map.keys($-durations)}.';
}

@each $key in (enter-easing, exit-easing) {
Expand Down
5 changes: 4 additions & 1 deletion packages/styles/scss/components/card/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,10 @@

position: absolute;
display: block;
border-radius: if(enabled('enable-v12-release'), $border-radius-08, null);
@if enabled('enable-v12-release') {
border-radius: $border-radius-08;
}

block-size: 100%;
box-shadow: inset 0 -80px 70px -65px $ai-inner-shadow;
content: '';
Expand Down
12 changes: 8 additions & 4 deletions packages/styles/scss/components/popover/_popover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ $popover-border-color: custom-property.get-var(
);

// The border radius value for the popover container
$popover-border-radius: custom-property.get-var(
'popover-border-radius',
if(enabled('enable-v12-release'), $border-radius-08, 2px)
);
$popover-border-radius: custom-property.get-var('popover-border-radius', 2px);

@if enabled('enable-v12-release') {
$popover-border-radius: custom-property.get-var(
'popover-border-radius',
$border-radius-08
);
}

// The text color used for text placed inside of the popover
$popover-text-color: custom-property.get-var(
Expand Down
26 changes: 15 additions & 11 deletions packages/styles/scss/components/toggletip/_toggletip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,22 @@
}

.#{$prefix}--toggletip {
@include custom-property.declaration(
'popover-offset',
if(
enabled('enable-v12-release'),
convert.to-rem(4px),
@if enabled('enable-v12-release') {
@include custom-property.declaration(
'popover-offset',
convert.to-rem(4px)
);
@include custom-property.declaration(
'popover-border-radius',
$border-radius-04
);
} @else {
@include custom-property.declaration(
'popover-offset',
convert.to-rem(13px)
)
);
@include custom-property.declaration(
'popover-border-radius',
if(enabled('enable-v12-release'), $border-radius-04, 2px)
);
);
@include custom-property.declaration('popover-border-radius', 2px);
}
}

.#{$prefix}--toggletip-content {
Expand Down
42 changes: 29 additions & 13 deletions packages/styles/scss/components/tooltip/_tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,36 @@

$tooltip-padding-block: custom-property.get-var(
'tooltip-padding-block',
if(enabled('enable-v12-release'), spacing.$spacing-02, spacing.$spacing-05)
spacing.$spacing-05
);

@if enabled('enable-v12-release') {
$tooltip-padding-block: custom-property.get-var(
'tooltip-padding-block',
spacing.$spacing-02
);
}

$tooltip-padding-inline: custom-property.get-var(
'tooltip-padding-inline',
spacing.$spacing-05
);

@mixin tooltip {
.#{$prefix}--tooltip {
@include custom-property.declaration(
'popover-offset',
if(enabled('enable-v12-release'), convert.to-rem(4px), 12px)
);
@include custom-property.declaration(
'popover-border-radius',
if(enabled('enable-v12-release'), $border-radius-04, 2px)
);
@if enabled('enable-v12-release') {
@include custom-property.declaration(
'popover-offset',
convert.to-rem(4px)
);
@include custom-property.declaration(
'popover-border-radius',
$border-radius-04
);
} @else {
@include custom-property.declaration('popover-offset', 12px);
@include custom-property.declaration('popover-border-radius', 2px);
}
}

.#{$prefix}--tooltip-content {
Expand Down Expand Up @@ -69,10 +81,14 @@ $tooltip-padding-inline: custom-property.get-var(
}

.#{$prefix}--definition-tooltip {
@include custom-property.declaration(
'popover-border-radius',
if(enabled('enable-v12-release'), $border-radius-04, 2px)
);
@if enabled('enable-v12-release') {
@include custom-property.declaration(
'popover-border-radius',
$border-radius-04
);
} @else {
@include custom-property.declaration('popover-border-radius', 2px);
}
@include type.type-style('body-01');

padding: convert.to-rem(8px) convert.to-rem(16px);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ $block-class: #{$prefix}--action-set;

// Mixin for button separator styles
@mixin button-separator($direction: horizontal) {
$shadow: if(
$direction == horizontal,
to-rem(-1px) 0 0 0 button-tokens.$button-separator,
0 to-rem(-1px) 0 0 button-tokens.$button-separator
);
$shadow: to-rem(-1px) 0 0 0 button-tokens.$button-separator;

@if $direction != horizontal {
$shadow: 0 to-rem(-1px) 0 0 button-tokens.$button-separator;
}

// Slotted buttons
::slotted(#{$prefix}-button:not(:first-of-type)) {
Expand Down
Loading