Handle sass compilation with a gradle plugin

This commit is contained in:
Daniil Reutsky 2022-05-08 22:53:10 +03:00
parent efd38f4c11
commit d30b7a2392
41 changed files with 36 additions and 3966 deletions

2
.gitignore vendored
View File

@ -3,6 +3,8 @@ build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
data/**/*.css
!data/**/libs/*.css
### STS ###
.apt_generated

View File

@ -1,9 +1,11 @@
import ru.mipt.npm.gradle.KScienceVersions
import sass.embedded_protocol.EmbeddedSass.OutputStyle
plugins {
id("ru.mipt.npm.gradle.project")
id("ru.mipt.npm.gradle.jvm")
application
id("io.freefair.sass-java") version "6.4.3"
}
//repositories{
@ -51,8 +53,28 @@ kotlin {
}
val dataSourcePath = project.rootDir.resolve("data")
sourceSets {
main {
resources.srcDir(project.rootDir.resolve("data"))
resources.srcDir(dataSourcePath)
}
}
}
tasks.compileSass {
destinationDir.set(dataSourcePath)
sourceMapEnabled.set(false)
setOutputStyle(OutputStyle.COMPRESSED.toString())
}
tasks.processResources {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
exclude("**/*.scss")
}
tasks.clean {
delete(fileTree(dataSourcePath).matching {
include("**/*.css")
exclude("**/libs/*.css")
})
}

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +0,0 @@
/*
Hyperspace by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
*/
/* Spotlights */
.spotlights > section > .image:before {
opacity: 0 !important;
}
.spotlights > section > .content > .inner {
-moz-transform: none !important;
-webkit-transform: none !important;
-ms-transform: none !important;
transform: none !important;
opacity: 1 !important;
}
/* Wrapper */
.wrapper > .inner {
opacity: 1 !important;
-moz-transform: none !important;
-webkit-transform: none !important;
-ms-transform: none !important;
transform: none !important;
}
/* Sidebar */
#sidebar > .inner {
opacity: 1 !important;
}
#sidebar nav > ul > li {
-moz-transform: none !important;
-webkit-transform: none !important;
-ms-transform: none !important;
transform: none !important;
opacity: 1 !important;
}

View File

@ -0,0 +1,6 @@
.collapsible-content {
padding: 0 18px;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}

View File

Before

Width:  |  Height:  |  Size: 801 B

After

Width:  |  Height:  |  Size: 801 B

View File

@ -4,7 +4,7 @@
@import 'libs/vendor';
@import 'libs/breakpoints';
@import 'libs/html-grid';
@import 'fontawesome-all.min.css';
@import 'libs/fontawesome-all.min.css';
/*
Hyperspace by HTML5 UP
@ -48,6 +48,7 @@
@import 'components/spotlights';
@import 'components/table';
@import 'components/wrapper';
@import 'components/collapsible';
// Layout.

View File

@ -207,7 +207,7 @@ context(PageContext) internal fun HTML.magProgHead(title: String) {
}
link {
rel = "stylesheet"
href = resolveRef("css/main.css")
href = resolveRef("styles/main.css")
}
link {
rel = "shortcut icon"
@ -216,7 +216,7 @@ context(PageContext) internal fun HTML.magProgHead(title: String) {
noScript {
link {
rel = "stylesheet"
href = resolveRef("css/noscript.css")
href = resolveRef("styles/noscript.css")
}
}
}