IMPR: Namespaces refactoring

This commit is contained in:
Tony Air 2021-03-15 03:46:04 +07:00
parent 91d60b815a
commit f5d178d310
3 changed files with 117 additions and 105 deletions

View File

@ -7,36 +7,42 @@
html, html,
body { body {
min-height: 100%; min-height: 100%;
min-height: 100vh; min-height: 100vh;
} }
// sticky footer // sticky footer
body { body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
--body-gutter-x: #{inspect($body-gutter-x)}; --body-bg: #{inspect($body-bg)};
--body-gutter-y: #{inspect($body-gutter-y)}; --body-color: #{inspect($body-color)};
--body-gutter-reduced-x: #{inspect($body-gutter-reduced-x)}; --body-gutter-x: #{inspect($body-gutter-x)};
--body-gutter-reduced-y: #{inspect($body-gutter-reduced-y)}; --body-gutter-y: #{inspect($body-gutter-y)};
--body-gutter-reduced-x: #{inspect($body-gutter-reduced-x)};
--body-gutter-reduced-y: #{inspect($body-gutter-reduced-y)};
.wrapper { .wrapper {
flex: 1 0 auto; flex: 1 0 auto;
margin-bottom: $element-spacer-y; margin-bottom: $element-spacer-y;
} }
.footer {
flex-shrink: 0; .footer {
margin-top: $element-spacer-y; flex-shrink: 0;
} margin-top: $element-spacer-y;
}
} }
@media (min-width: $extra-large-screen) { @media (min-width: $extra-large-screen) {
html, body {
font-size: .9vw!important; html,
} body {
.container { font-size: .9vw !important;
max-width: 80vw; }
}
.container {
max-width: 80vw;
}
} }
// don't let images be wider than the parent layer // don't let images be wider than the parent layer
@ -45,55 +51,57 @@ a,
span, span,
button, button,
i { i {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: contain; background-size: contain;
} }
iframe, iframe,
img { img {
max-width: 100%; max-width: 100%;
} }
ul, ul,
table, table,
p { p {
&:first-child { &:first-child {
margin-top: 0; margin-top: 0;
} }
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
} }
.a { .a {
cursor: pointer; cursor: pointer;
color: $link-color; color: $link-color;
text-decoration: $link-decoration; text-decoration: $link-decoration;
&:hover,
&:focus { &:hover,
text-decoration: $link-hover-decoration; &:focus {
color: $link-hover-color; text-decoration: $link-hover-decoration;
} color: $link-hover-color;
}
} }
// exclude bootstrap-table // exclude bootstrap-table
[data-toggle='table'] { [data-toggle='table'] {
&:hover,
&.active, &:hover,
&:focus { &.active,
opacity: 1; &:focus {
} opacity: 1;
}
} }
[data-toggle='collapse'] { [data-toggle='collapse'] {
&[aria-expanded='true'] { &[aria-expanded='true'] {
.accordion-icon { .accordion-icon {
&:before { &:before {
content: '\f068'; content: '\f068';
} }
} }
} }
} }
// transactions // transactions
@ -116,7 +124,7 @@ textarea,
.message, .message,
[data-toggle], [data-toggle],
[data-toggle] * { [data-toggle] * {
transition: all 0.4s ease; transition: all 0.4s ease;
} }
.a, .a,
@ -124,43 +132,46 @@ a,
[data-toggle], [data-toggle],
button, button,
.btn { .btn {
&:hover,
&.active,
&[aria-expanded='true'] {
> .fa,
> .far,
> .fas,
> .fab,
&.fa,
&.far,
&.fas,
&.fab {
transform: rotate(-180deg);
}
}
&:hover, &:hover,
&[aria-expanded='true'] { &.active,
opacity: 0.8; &[aria-expanded='true'] {
}
&.disabled { >.fa,
opacity: 0.5; >.far,
cursor: default; >.fas,
>.fab,
&.fa,
&.far,
&.fas,
&.fab {
transform: rotate(-180deg);
}
}
&:hover, &:hover,
&.active, &[aria-expanded='true'] {
&[aria-expanded='true'] { opacity: 0.8;
> .fa, }
> .far,
> .fas, &.disabled {
> .fab, opacity: 0.5;
&.fa, cursor: default;
&.far,
&.fas, &:hover,
&.fab { &.active,
transform: rotate(0deg); &[aria-expanded='true'] {
}
} >.fa,
} >.far,
>.fas,
>.fab,
&.fa,
&.far,
&.fas,
&.fab {
transform: rotate(0deg);
}
}
}
} }

View File

@ -2,7 +2,8 @@
* Load webpack configuration from app/_config/webpack.yml * Load webpack configuration from app/_config/webpack.yml
*/ */
const YML_PATH = '/webpack.yml'; const YML_PATH = '/app/_config/webpack.yml';
const CONF_VAR = 'App\\Templates\\WebpackTemplateProvider';
const path = require('path'); const path = require('path');
const filesystem = require('fs'); const filesystem = require('fs');
@ -10,28 +11,28 @@ const fs = require('fs');
const yaml = require('js-yaml'); const yaml = require('js-yaml');
const conf = yaml.safeLoad( const conf = yaml.safeLoad(
fs.readFileSync(path.join(__dirname, YML_PATH), 'utf8'), fs.readFileSync(path.join(__dirname, YML_PATH), 'utf8'),
); );
let themes = []; let themes = [];
// add themes // add themes
if (conf['Site\\Templates\\WebpackTemplateProvider'].THEMESDIR) { if (conf[CONF_VAR].THEMESDIR) {
const themeDir = conf['Site\\Templates\\WebpackTemplateProvider'].THEMESDIR; const themeDir = conf[CONF_VAR].THEMESDIR;
const dir = path.resolve(__dirname, themeDir); const dir = path.resolve(__dirname, themeDir);
if (filesystem.existsSync(dir)) { if (filesystem.existsSync(dir)) {
filesystem.readdirSync(dir).forEach((file) => { filesystem.readdirSync(dir).forEach((file) => {
filePath = path.join(themeDir, file); filePath = path.join(themeDir, file);
const stat = filesystem.statSync(filePath); const stat = filesystem.statSync(filePath);
if (stat && stat.isDirectory()) { if (stat && stat.isDirectory()) {
themes.push(filePath); themes.push(filePath);
} }
}); });
} }
} }
module.exports = { module.exports = {
configuration: conf['Site\\Templates\\WebpackTemplateProvider'], configuration: conf[CONF_VAR],
themes: themes, themes: themes,
}; };

View File

@ -2,7 +2,7 @@
# with all configuration variables presented # with all configuration variables presented
# Cuz WebPack compiling script use it to set configuration # Cuz WebPack compiling script use it to set configuration
Site\Templates\WebpackTemplateProvider: App\Templates\WebpackTemplateProvider:
APPDIR: ./ APPDIR: ./
THEMESDIR: themes THEMESDIR: themes
HOSTNAME: 127.0.0.1 HOSTNAME: 127.0.0.1