Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal 'dspace' theme #1063

Merged
merged 9 commits into from Apr 9, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions angular.json
Expand Up @@ -56,6 +56,11 @@
"input": "src/themes/custom/styles/theme.scss",
"inject": false,
"bundleName": "custom-theme"
},
{
"input": "src/themes/dspace/styles/theme.scss",
"inject": false,
"bundleName": "dspace-theme"
}
],
"scripts": []
Expand Down
37 changes: 0 additions & 37 deletions src/assets/images/dspace-logo-monochrome.svg

This file was deleted.

8 changes: 6 additions & 2 deletions src/environments/environment.common.ts
Expand Up @@ -255,10 +255,14 @@ export const environment: GlobalConfig = {
// // A theme with only a name will match every route
// name: 'custom'
// },
// {
// // This theme will use the default bootstrap styling for DSpace components
// name: BASE_THEME_NAME
// },

{
// This theme will use the default bootstrap styling for DSpace components
name: BASE_THEME_NAME
// The default dspace theme
name: 'dspace'
},
],
// Whether the UI should rewrite file download URLs to match its domain. Only necessary to enable when running UI and REST API on separate domains
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Expand Up @@ -7,7 +7,7 @@
<title>DSpace</title>
<meta name="viewport" content="width=device-width,minimum-scale=1">
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico" />
<link class="theme-css" rel="stylesheet" href="/base-theme.css">
<link class="theme-css" rel="stylesheet" href="/dspace-theme.css">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this has been replaced with the themed css? Should the theme applied override the base-theme.css automatically?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should, feel free to put it back and verify that it will update automatically. But it's an efficiency thing.

If you put the css needed for the initial page load there in the first place, it prevents people from having to download the wrong css first, before app.component can replace it.

It is something I would recommend everybody does after they've decided on the theme they want.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it makes sense, maybe for the 7.1 we can think to improve it by selecting the css according to the chosen theme. It could be made with webpack, here an article that could help https://medium.com/dailyjs/inserting-variables-into-html-and-javascript-with-webpack-80f33625edc6

</head>

<body>
Expand Down
1 change: 0 additions & 1 deletion src/styles/_mixins.scss
@@ -1,4 +1,3 @@
@import '../../node_modules/bootstrap/scss/functions.scss';
@import '../../node_modules/bootstrap/scss/mixins.scss';

@mixin word-wrap() {
Expand Down
@@ -0,0 +1,26 @@
<div class="background-image">
<div class="container">
<div class="jumbotron jumbotron-fluid">
<div class="d-flex flex-wrap">
<div>
<h1 class="display-3">DSpace 7</h1>
<p class="lead">DSpace is the world leading open source repository platform that enables
organisations to:</p>
</div>
</div>
<ul>
<li>easily ingest documents, audio, video, datasets and their corresponding Dublin Core
metadata
</li>
<li>open up this content to local and global audiences, thanks to the OAI-PMH interface and
Google Scholar optimizations
</li>
<li>issue permanent urls and trustworthy identifiers, including optional integrations with
handle.net and DataCite DOI
</li>
</ul>
<p>Join an international community of <a href="https://wiki.lyrasis.org/display/DSPACE/DSpace+Positioning" target="_blank">leading institutions using DSpace</a>.</p>
</div>
</div>
<small class="credits">Photo by <a href="https://www.pexels.com/@inspiredimages">@inspiredimages</a></small>
</div>
@@ -0,0 +1,69 @@
:host {
display: block;
margin-top: calc(var(--ds-content-spacing) * -1);

div.background-image {
color: white;
background-color: var(--bs-info);
position: relative;
background-position-y: -200px;
background-image: url('/assets/dspace/images/banner.jpg');
background-size: cover;
@media screen and (max-width: map-get($grid-breakpoints, lg)) {
background-position-y: 0;
}

.container {
position: relative;
text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);

&:before, &:after {
content: '';
display: block;
width: var(--ds-banner-background-gradient-width);
height: 100%;
top: 0;
position: absolute;
}

&:before {
background: linear-gradient(to left, var(--ds-banner-text-background), transparent);
left: calc(-1 * var(--ds-banner-background-gradient-width));

}

&:after {
background: linear-gradient(to right, var(--ds-banner-text-background), transparent);
right: calc(-1 * var(--ds-banner-background-gradient-width));
}

background-color: var(--ds-banner-text-background);
}


small.credits {
a {
color: inherit;
}

opacity: 0.3;
position: absolute;
right: var(--bs-spacer);
bottom: 0;
}
}

.jumbotron {
background-color: transparent;
}

a {
color: var(--ds-home-news-link-color);

@include hover {
color: var(--ds-home-news-link-hover-color);
}
}
}


14 changes: 14 additions & 0 deletions src/themes/dspace/app/+home-page/home-news/home-news.component.ts
@@ -0,0 +1,14 @@
import { Component } from '@angular/core';
import { HomeNewsComponent as BaseComponent } from '../../../../../app/+home-page/home-news/home-news.component';

@Component({
selector: 'ds-home-news',
styleUrls: ['./home-news.component.scss'],
templateUrl: './home-news.component.html'
})

/**
* Component to render the news section on the home page
*/
export class HomeNewsComponent extends BaseComponent {}

@@ -1,7 +1,5 @@
@import 'src/app/navbar/navbar.component.scss';

nav.navbar {
border-bottom: 5px $green solid;
border-bottom: 5px var(--bs-green) solid;
}


15 changes: 15 additions & 0 deletions src/themes/dspace/app/navbar/navbar.component.ts
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';
import { NavbarComponent as BaseComponent } from '../../../../app/navbar/navbar.component';
import { slideMobileNav } from '../../../../app/shared/animations/slide';

/**
* Component representing the public navbar
*/
@Component({
selector: 'ds-navbar',
styleUrls: ['./navbar.component.scss'],
templateUrl: '../../../../app/navbar/navbar.component.html',
animations: [slideMobileNav]
})
export class NavbarComponent extends BaseComponent {
}
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions src/themes/dspace/entry-components.ts
@@ -0,0 +1,2 @@
export const ENTRY_COMPONENTS = [
];
23 changes: 23 additions & 0 deletions src/themes/dspace/styles/_global-styles.scss
@@ -0,0 +1,23 @@
// Add any global css for the theme here

// imports the base global style
@import '../../../styles/_global-styles.scss';

.facet-filter,.setting-option {
background-color: var(--bs-light);
border-radius: var(--bs-border-radius);

&.p-3 {
// Needs !important because the original bootstrap class uses it
padding-top: 0.5rem !important;
padding-bottom: 0.5rem !important;
}

.badge-secondary {
background-color: var(--bs-primary);
}

h5 {
font-size: 1.1rem
}
}
9 changes: 9 additions & 0 deletions src/themes/dspace/styles/_theme_css_variable_overrides.scss
@@ -0,0 +1,9 @@
// Override or add CSS variables for your theme here

:root {
--ds-banner-text-background: rgba(0, 0, 0, 0.45);
--ds-banner-background-gradient-width: 300px;
--ds-home-news-link-color: #{$green};
--ds-home-news-link-hover-color: #{darken($green, 15%)};
}

30 changes: 30 additions & 0 deletions src/themes/dspace/styles/_theme_sass_variable_overrides.scss
@@ -0,0 +1,30 @@
// DSpace works with CSS variables for its own components, and has a mapping of all bootstrap Sass
// variables to CSS equivalents (see src/styles/_bootstrap_variables_mapping.scss). However Bootstrap
// still uses Sass variables internally. So if you want to override bootstrap (or other sass
// variables) you can do so here. Their CSS counterparts will include the changes you make here

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;1,200;1,300;1,400;1,600;1,700;1,800&display=swap');

$font-family-sans-serif: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
$gray-100: #e8ebf3 !default;
$gray-400: #ced4da !default;
$gray-600: #959595 !default;
$gray-800: #444444 !default;

$navbar-dark-color: #FFFFFF;

/* Reassign color vars to semantic color scheme */
$blue: #43515f !default;
$green: #92C642 !default;
$cyan: #207698 !default;
$yellow: #ec9433 !default;
$red: #CF4444 !default;
$dark: #43515f !default;

$body-color: $gray-800 !default;

$table-accent-bg: $gray-100 !default;
$table-hover-bg: $gray-400 !default;

$yiq-contrasted-threshold: 170 !default;

12 changes: 12 additions & 0 deletions src/themes/dspace/styles/theme.scss
@@ -0,0 +1,12 @@
// This file combines the other scss files in to one. You usually shouldn't edit this file directly

@import './_theme_sass_variable_overrides.scss';
@import '../../../styles/_variables.scss';
@import '../../../styles/_mixins.scss';
@import '../../../styles/helpers/font_awesome_imports.scss';
@import '../../../../node_modules/bootstrap/scss/bootstrap.scss';
@import '../../../../node_modules/nouislider/distribute/nouislider.min';
@import '../../../styles/_custom_variables.scss';
@import './_theme_css_variable_overrides.scss';
@import '../../../styles/bootstrap_variables_mapping.scss';
@import './_global-styles.scss';