Skip to content
Merged
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
4 changes: 2 additions & 2 deletions includes/class-newspack-ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ public static function return_demo_content() {
</ul>
</div>
</div>
<div class="newspack-ui__spacing-top--16"></div>
<div class="newspack-ui__spacing-top--3"></div>
<div class="newspack-ui__dropdown">
<button class="newspack-ui__button newspack-ui__button--outline newspack-ui__button--small newspack-ui__dropdown__toggle">
<span>Actions</span>
Expand Down Expand Up @@ -849,7 +849,7 @@ public static function return_demo_content() {
</div>
</div>

<div class="newspack-ui__segmented-control__form-control newspack-ui__spacing-top--32">
<div class="newspack-ui__segmented-control__form-control newspack-ui__spacing-top--6">
<label>Segmented Control (Form) <abbr class="newspack-ui__required" title="required">*</abbr></label>
<div class="newspack-ui__segmented-control__tabs">
<button class="newspack-ui__button newspack-ui__button--small selected">True</button>
Expand Down
32 changes: 17 additions & 15 deletions includes/content-gate/class-ip-access-rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ public static function render_loading_page( $institution_id = null ) {
<title><?php echo esc_html( $inst_name ? $inst_name . ' — ' . $site_name : $site_name ); ?> — <?php esc_html_e( 'Verifying access', 'newspack-plugin' ); ?></title>
<?php wp_head(); ?>
<style>
.newspack-ui__ip-check__actions { display: none; }
#ip-check #ip-check-actions { display: none; }
.newspack-ui__ip-check--error .newspack-ui__spinner > span { display: none; }
.newspack-ui__ip-check--error .newspack-ui__ip-check__actions { display: flex; gap: var(--newspack-ui-spacer-2); justify-content: center; }
.newspack-ui__ip-check__image { max-width: 400px; max-height: 200px; object-fit: contain; }
#ip-check.newspack-ui__ip-check--error #ip-check-actions { display: flex; }
.newspack-ui__ip-check__image { max-width: 256px; max-height: 192px; object-fit: contain; }
</style>
</head>
<body>
Expand All @@ -334,18 +334,20 @@ public static function render_loading_page( $institution_id = null ) {
<img class="newspack-ui__ip-check__image" src="<?php echo esc_url( $inst_image ); ?>" alt="<?php echo esc_attr( $inst_name ); ?>">
<?php endif; ?>
<span></span>
<p class="newspack-ui__font--m" id="ip-check-message">
<?php
if ( $inst_name ) {
/* translators: %s: institution name */
printf( esc_html__( 'Verifying your access to %s…', 'newspack-plugin' ), '<strong>' . esc_html( $inst_name ) . '</strong>' );
} else {
esc_html_e( 'Verifying your access…', 'newspack-plugin' );
}
?>
</p>
<p class="newspack-ui__font--xs" id="ip-check-detail" style="color: var(--newspack-ui-color-neutral-50);"><?php esc_html_e( "You'll be redirected in a few seconds.", 'newspack-plugin' ); ?></p>
<div class="newspack-ui__ip-check__actions" id="ip-check-actions">
<div class="newspack-ui__stack newspack-ui__stack--vertical newspack-ui__stack--align-center newspack-ui__font--s">
<p id="ip-check-message">
<?php
if ( $inst_name ) {
/* translators: %s: institution name */
printf( esc_html__( 'Verifying your access to %s…', 'newspack-plugin' ), '<strong>' . esc_html( $inst_name ) . '</strong>' );
} else {
esc_html_e( 'Verifying your access…', 'newspack-plugin' );
}
?>
</p>
<p class="newspack-ui__font--normal newspack-ui__color--neutral-60" id="ip-check-detail"><?php esc_html_e( "You'll be redirected in a few seconds.", 'newspack-plugin' ); ?></p>
</div>
Comment thread
thomasguillot marked this conversation as resolved.
<div class="newspack-ui__stack newspack-ui__stack--justify-center" id="ip-check-actions">
<button class="newspack-ui__button newspack-ui__button--primary newspack-ui__button--small" onclick="location.reload()"><?php esc_html_e( 'Try again', 'newspack-plugin' ); ?></button>
<a class="newspack-ui__button newspack-ui__button--outline newspack-ui__button--small" href="<?php echo esc_url( $redirect_url ); ?>"><?php esc_html_e( 'Continue to site', 'newspack-plugin' ); ?></a>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/contribution-meter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
flex-wrap: wrap;
gap: var(--newspack-ui-spacer-3);
justify-content: space-between;
margin-bottom: var(--newspack-ui-spacer-base);
row-gap: calc(var(--newspack-ui-spacer-base) / 2);
margin-bottom: var(--newspack-ui-spacer-1);
row-gap: calc(var(--newspack-ui-spacer-1) / 2);

> span {
display: inline-block;
Expand Down Expand Up @@ -95,7 +95,7 @@
align-items: center;
display: flex;
flex-direction: column;
gap: var(--newspack-ui-spacer-base);
gap: var(--newspack-ui-spacer-1);

@media (min-width: 600px) {
flex-direction: row;
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/reader-registration/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
margin-bottom: var(--newspack-ui-spacer-5);

&:has(+ p) {
margin-bottom: var(--newspack-ui-spacer-base);
margin-bottom: var(--newspack-ui-spacer-1);
}
}

Expand Down Expand Up @@ -140,7 +140,7 @@

&:has(em) {
border-top: 1px solid var(--newspack-ui-color-border);
gap: calc(var(--newspack-ui-spacer-base) / 2);
gap: calc(var(--newspack-ui-spacer-1) / 2);
padding-top: var(--newspack-ui-spacer-2);
}

Expand Down Expand Up @@ -177,7 +177,7 @@
line-height: var(--newspack-ui-line-height-xs);

p {
margin: var(--newspack-ui-spacer-base) 0 0;
margin: var(--newspack-ui-spacer-1) 0 0;
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/my-account/v1/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
.legend {
display: block;
margin: var(--newspack-ui-spacer-base) 0;
margin: var(--newspack-ui-spacer-1) 0;
}
small {
font-size: inherit;
Expand Down Expand Up @@ -65,10 +65,10 @@
.woocommerce-password-strength {
display: block;
font-size: var(--newspack-ui-font-size-xs);
margin: var(--newspack-ui-spacer-base) 0;
margin: var(--newspack-ui-spacer-1) 0;
& + small {
display: block;
margin-top: calc(var(--newspack-ui-spacer-base) * -1);
margin-top: calc(var(--newspack-ui-spacer-1) * -1);
}
&.short,
&.bad {
Expand Down
4 changes: 2 additions & 2 deletions src/my-account/v1/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
display: none;
height: var(--newspack-ui-spacer-9);
margin: var(--newspack-ui-spacer-6) var(--newspack-ui-spacer-3) 0;
padding: calc(var(--newspack-ui-spacer-base) * 0.5);
padding: calc(var(--newspack-ui-spacer-1) * 0.5);
place-items: center;
transition: border-color 125ms ease-in-out;
width: var(--newspack-ui-spacer-9);
Expand Down Expand Up @@ -207,7 +207,7 @@
font-size: var(--newspack-ui-font-size-xs);
font-weight: 400;
margin: 0;
padding: calc(var(--newspack-ui-spacer-base) * 0.75) 0;
padding: calc(var(--newspack-ui-spacer-1) * 0.75) 0;
text-decoration: underline;
&:hover {
background: none;
Expand Down
12 changes: 6 additions & 6 deletions src/my-account/v1/_subscriptions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
&--title {
align-items: center;
display: flex;
gap: var(--newspack-ui-spacer-base);
gap: var(--newspack-ui-spacer-1);

h2 {
margin: 0;
Expand All @@ -99,7 +99,7 @@
margin: 0;

@media ( min-width: 768px ) {
margin-left: calc(var(--newspack-ui-spacer-8) * -1 - var(--newspack-ui-spacer-base));
margin-left: calc(var(--newspack-ui-spacer-8) * -1 - var(--newspack-ui-spacer-1));
}
}
&--actions {
Expand All @@ -119,7 +119,7 @@
font-size: var(--newspack-ui-font-size-xs);
line-height: var(--newspack-ui-line-height-xs);
min-height: var(--newspack-ui-spacer-8);
padding: var(--newspack-ui-spacer-base) var(--newspack-ui-spacer-3);
padding: var(--newspack-ui-spacer-1) var(--newspack-ui-spacer-3);
&.newspack-my-account__subscription--action-link {
display: none;
}
Expand All @@ -130,10 +130,10 @@
background: var(--newspack-ui-color-neutral-60);
border-radius: 100%;
display: inline-grid;
height: var(--newspack-ui-spacer-base);
height: var(--newspack-ui-spacer-1);
margin-bottom: 1px;
margin-right: calc( var(--newspack-ui-spacer-base) - 0.25em);
width: var(--newspack-ui-spacer-base);
margin-right: calc( var(--newspack-ui-spacer-1) - 0.25em);
width: var(--newspack-ui-spacer-1);
&.completed,
&.refunded {
background: var(--newspack-ui-color-success-50);
Expand Down
6 changes: 3 additions & 3 deletions src/newspack-ui/scss/elements/_boxes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

// Sizes
&--2x-small {
padding: var(--newspack-ui-spacer-base);
padding: var(--newspack-ui-spacer-1);
}
&--x-small {
padding: var(--newspack-ui-spacer-2);
Expand Down Expand Up @@ -65,7 +65,7 @@
&__actions {
display: flex;
flex-direction: column;
gap: var(--newspack-ui-spacer-base);
gap: var(--newspack-ui-spacer-1);
justify-content: space-between;
> * {
margin: 0 !important;
Expand All @@ -85,7 +85,7 @@
}
.newspack-ui__badge {
float: right;
margin-left: calc(var(--newspack-ui-spacer-base) / 2);
margin-left: calc(var(--newspack-ui-spacer-1) / 2);
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions src/newspack-ui/scss/elements/_colors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$color-scales: (
"neutral": (0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100),
"primary": (0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100),
"success": (0, 5, 50, 60),
"error": (0, 5, 50, 60),
"warning": (0, 5, 30, 40),
);

.newspack-ui {
@each $name, $steps in $color-scales {
@each $step in $steps {
&__color--#{$name}-#{$step} {
color: var(--newspack-ui-color-#{$name}-#{$step});
}
}
}
}
2 changes: 2 additions & 0 deletions src/newspack-ui/scss/elements/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
@use "icons";
@use "misc";
@use "segmented-control";
@use "stack";
@use "tables";
@use "typography";
@use "colors";
@use "woocommerce";
2 changes: 1 addition & 1 deletion src/newspack-ui/scss/elements/_notices.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
display: block;
fill: var(--newspack-ui-color-neutral-90);
flex: 0 0 24px;
margin-right: var(--newspack-ui-spacer-base);
margin-right: var(--newspack-ui-spacer-1);
}

// Backgrounds & Borders
Expand Down
18 changes: 9 additions & 9 deletions src/newspack-ui/scss/elements/_segmented-control.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

&__form-control {
display: grid;
gap: var(--newspack-ui-spacer-base);
gap: var(--newspack-ui-spacer-1);
width: 100%;

label {
Expand All @@ -28,18 +28,18 @@
border-radius: var(--newspack-ui-border-radius-m);
display: flex;
flex-wrap: wrap;
gap: var(--newspack-ui-spacer-base);
gap: var(--newspack-ui-spacer-1);
justify-content: center;
padding: var(--newspack-ui-spacer-base);
padding: var(--newspack-ui-spacer-1);

&:has([class*="--x-small"]) {
gap: calc(var(--newspack-ui-spacer-base) * 0.75);
padding: calc(var(--newspack-ui-spacer-base) * 0.75);
gap: calc(var(--newspack-ui-spacer-1) * 0.75);
padding: calc(var(--newspack-ui-spacer-1) * 0.75);
}

&:has([class*="--small"]) {
gap: calc(var(--newspack-ui-spacer-base) / 2);
padding: calc(var(--newspack-ui-spacer-base) / 2);
gap: calc(var(--newspack-ui-spacer-1) / 2);
padding: calc(var(--newspack-ui-spacer-1) / 2);
}

.newspack-ui__button {
Expand All @@ -54,13 +54,13 @@

&[class*="--x-small"] {
padding:
calc(var(--newspack-ui-spacer-base) * 0.75 - 1px)
calc(var(--newspack-ui-spacer-1) * 0.75 - 1px)
calc(var(--newspack-ui-spacer-2) - 1px);
}

&[class*="--small"] {
padding:
calc(var(--newspack-ui-spacer-base) - 1px)
calc(var(--newspack-ui-spacer-1) - 1px)
calc(var(--newspack-ui-spacer-3) - 1px);
}

Expand Down
78 changes: 78 additions & 0 deletions src/newspack-ui/scss/elements/_stack.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
$stack-align: (
"start": flex-start,
"center": center,
"end": flex-end,
"stretch": stretch,
"baseline": baseline,
);

$stack-justify: (
"start": flex-start,
"center": center,
"end": flex-end,
"between": space-between,
);

$stack-gaps: (
"0": 0,
"1": var(--newspack-ui-spacer-1),
"2": var(--newspack-ui-spacer-2),
"3": var(--newspack-ui-spacer-3),
"4": var(--newspack-ui-spacer-4),
"5": var(--newspack-ui-spacer-5),
"6": var(--newspack-ui-spacer-6),
"7": var(--newspack-ui-spacer-7),
"8": var(--newspack-ui-spacer-8),
"9": var(--newspack-ui-spacer-9),
"10": var(--newspack-ui-spacer-10),
"11": var(--newspack-ui-spacer-11),
"12": var(--newspack-ui-spacer-12),
);

.newspack-ui {
&__stack {
display: flex;
flex-direction: row;
gap: var(--newspack-ui-spacer-2);

&--horizontal {
flex-direction: row;

> :where(:not([class*="newspack-ui__spacing-"])) {
margin-left: 0;
margin-right: 0;
}
}

&--vertical {
flex-direction: column;

> :where(:not([class*="newspack-ui__spacing-"])) {
margin-bottom: 0;
margin-top: 0;
}
}

@each $name, $value in $stack-align {
&--align-#{$name} {
align-items: $value;
}
}

@each $name, $value in $stack-justify {
&--justify-#{$name} {
justify-content: $value;
}
}

&--wrap {
flex-wrap: wrap;
}

@each $name, $value in $stack-gaps {
&--gap-#{$name} {
gap: $value;
}
}
}
}
Loading
Loading