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

#1150 [CSS] add: css template in php file #1151

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
33 changes: 33 additions & 0 deletions core/tpl/utils/css.tpl.php
Copy link
Contributor

Choose a reason for hiding this comment

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

C'est pas bon ce référer au fichier module.css.php du modulebuilder

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/* Copyright (C) 2025 EVARISK <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/**
* \file core/tpl/utils/css.tpl.php
* \ingroup saturne
* \brief Template page for css in php
*/

/**
* The following vars must be defined :
* Parameters : $customColor
*/ ?>

<style>
:root {
--color__const__custom: <?php echo $customColor; ?>;
}
</style>
2 changes: 1 addition & 1 deletion css/saturne.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions css/scss/modules/button/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
background: $color__orange;
border-color: $color__orange;
}

&.button-custom {
background: var(--color__const__custom);
border-color: var(--color__const__custom);
}

&.button-transparent {
background: transparent;
border-color: transparent;
Expand Down
5 changes: 5 additions & 0 deletions css/scss/variable/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ $color__dark: #2b2b2b;
$color__grey: #ececec;
$color__blue: #0d8aff;
$color__green: #47e58e;
$color__const__custom: #966ea2f2;

:root {
--color__const__custom: $color__const__custom;
}