bulma/sass/components/media.scss

101 lines
2.5 KiB
SCSS
Raw Normal View History

2022-11-23 17:44:02 +00:00
@import "../utilities/mixins";
2022-12-06 00:47:43 +00:00
$media-border-color: bulmaRgba($border, 0.5) !default; // TODO
2022-11-23 17:44:02 +00:00
$media-border-size: 1px !default;
$media-spacing: 1rem !default;
$media-spacing-large: 1.5rem !default;
$media-content-spacing: 0.75rem !default;
$media-level-1-spacing: 0.75rem !default;
$media-level-1-content-spacing: 0.5rem !default;
$media-level-2-spacing: 0.5rem !default;
2022-12-06 00:47:43 +00:00
:root {
@include register-vars(
(
media-border-color: #{$media-border-color},
media-border-size: #{$media-border-size},
media-spacing: #{$media-spacing},
media-spacing-large: #{$media-spacing-large},
media-content-spacing: #{$media-content-spacing},
media-level-1-spacing: #{$media-level-1-spacing},
media-level-1-content-spacing: #{$media-level-1-content-spacing},
media-level-2-spacing: #{$media-level-2-spacing},
)
);
}
2022-11-23 22:53:56 +00:00
.#{$class-prefix}media {
2022-11-23 17:44:02 +00:00
align-items: flex-start;
display: flex;
text-align: inherit;
2022-11-23 22:53:56 +00:00
.#{$class-prefix}content:not(:last-child) {
2022-12-06 00:47:43 +00:00
margin-bottom: getVar("media-content-spacing");
2022-11-23 17:44:02 +00:00
}
2022-11-23 22:53:56 +00:00
.#{$class-prefix}media {
2022-12-06 00:47:43 +00:00
border-top-color: getVar("media-border-color");
border-top-style: solid;
border-top-width: getVar("media-border-size");
2022-11-23 17:44:02 +00:00
display: flex;
2022-12-06 00:47:43 +00:00
padding-top: getVar("media-level-1-spacing");
2022-11-23 17:44:02 +00:00
2022-11-23 22:53:56 +00:00
.#{$class-prefix}content:not(:last-child),
.#{$class-prefix}control:not(:last-child) {
2022-12-06 00:47:43 +00:00
margin-bottom: getVar("media-level-1-content-spacing");
2022-11-23 17:44:02 +00:00
}
2022-11-23 22:53:56 +00:00
.#{$class-prefix}media {
2022-12-06 00:47:43 +00:00
padding-top: getVar("media-level-2-spacing");
2022-11-23 17:44:02 +00:00
2022-11-23 22:53:56 +00:00
& + .#{$class-prefix}media {
2022-12-06 00:47:43 +00:00
margin-top: getVar("media-level-2-spacing");
2022-11-23 17:44:02 +00:00
}
}
}
2022-11-23 22:53:56 +00:00
& + .#{$class-prefix}media {
2022-12-06 00:47:43 +00:00
border-top-color: getVar("media-border-color");
border-top-style: solid;
border-top-width: getVar("media-border-size");
margin-top: getVar("media-spacing");
padding-top: getVar("media-spacing");
2022-11-23 17:44:02 +00:00
}
// Sizes
&.is-large {
2022-11-23 22:53:56 +00:00
& + .#{$class-prefix}media {
2022-12-06 00:47:43 +00:00
margin-top: getVar("media-spacing-large");
padding-top: getVar("media-spacing-large");
2022-11-23 17:44:02 +00:00
}
}
}
2022-11-23 22:53:56 +00:00
.#{$class-prefix}media-left,
.#{$class-prefix}media-right {
2022-11-23 17:44:02 +00:00
flex-basis: auto;
flex-grow: 0;
flex-shrink: 0;
}
2022-11-23 22:53:56 +00:00
.#{$class-prefix}media-left {
2022-12-06 00:47:43 +00:00
@include ltr-property("margin", getVar("media-spacing"));
2022-11-23 17:44:02 +00:00
}
2022-11-23 22:53:56 +00:00
.#{$class-prefix}media-right {
2022-12-06 00:47:43 +00:00
@include ltr-property("margin", getVar("media-spacing"), false);
2022-11-23 17:44:02 +00:00
}
2022-11-23 22:53:56 +00:00
.#{$class-prefix}media-content {
2022-11-23 17:44:02 +00:00
flex-basis: auto;
flex-grow: 1;
flex-shrink: 1;
text-align: inherit;
}
@include mobile {
2022-11-23 22:53:56 +00:00
.#{$class-prefix}media-content {
2022-11-23 17:44:02 +00:00
overflow-x: auto;
}
}