Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0cdcfe7
feat: migrate to scss
Revathyvenugopal162 Mar 6, 2025
1b17384
Merge branch 'main' into fix/add-scss
Revathyvenugopal162 Mar 7, 2025
c34d0e2
chore: adding changelog file 644.miscellaneous.md [dependabot-skip]
pyansys-ci-bot Mar 7, 2025
cc0fcbc
Update package.json
Revathyvenugopal162 Mar 7, 2025
f73b779
feat: add the post css dev dependencies
Revathyvenugopal162 Mar 7, 2025
496a199
Merge branch 'fix/add-scss' of https://github.com/ansys/ansys-sphinx-…
Revathyvenugopal162 Mar 7, 2025
b4cae9c
chore: adding changelog file 644.added.md [dependabot-skip]
pyansys-ci-bot Mar 7, 2025
1103a85
feat: add the post css dev deps
Revathyvenugopal162 Mar 7, 2025
db36f64
Merge branch 'fix/add-scss' of https://github.com/ansys/ansys-sphinx-…
Revathyvenugopal162 Mar 7, 2025
bdf301e
Merge branch 'main' into fix/add-scss
jorgepiloto Mar 10, 2025
d39cb81
feat: add the post css build
Revathyvenugopal162 Mar 10, 2025
e57c870
Merge branch 'fix/add-scss' of https://github.com/ansys/ansys-sphinx-…
Revathyvenugopal162 Mar 10, 2025
ec0e53a
feat: add the post css config
Revathyvenugopal162 Mar 10, 2025
41ede99
fix: add one package
Revathyvenugopal162 Mar 10, 2025
8f64f2c
fix: change search.scss
Revathyvenugopal162 Mar 10, 2025
bc90654
fix: clean ast-search.scss
Revathyvenugopal162 Mar 10, 2025
561150f
fix: clean breadcrumb.scss
Revathyvenugopal162 Mar 10, 2025
f2212aa
fix: clean sd.css
Revathyvenugopal162 Mar 10, 2025
d208343
Apply suggestions from code review
Revathyvenugopal162 Mar 11, 2025
7c3ebbc
fix: update codestyle
Revathyvenugopal162 Mar 11, 2025
92e483f
Merge branch 'main' into fix/add-scss
Revathyvenugopal162 Mar 11, 2025
bb6a97d
Merge branch 'main' into fix/add-scss
Revathyvenugopal162 Mar 12, 2025
3bed680
fix: change sphinx gallery sccs
Revathyvenugopal162 Mar 13, 2025
1eed6c8
fix: table scss reformat
Revathyvenugopal162 Mar 13, 2025
27d0eea
fix: whatsnew scss reformat
Revathyvenugopal162 Mar 13, 2025
06d68ce
fix: add css
Revathyvenugopal162 Mar 13, 2025
a4e96b6
fix: convert px to rem
Revathyvenugopal162 Mar 13, 2025
d0019d2
Merge branch 'main' into fix/add-scss
Revathyvenugopal162 Mar 17, 2025
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
28 changes: 8 additions & 20 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,19 @@ jobs:

changelog-fragment:
name: "Create changelog fragment"
needs: "labeler"
needs: [labeler]
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: "Setup python"
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: "Checkout repo"
uses: actions/checkout@v4

- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install -e .[changelog]

- uses: ansys/actions/doc-changelog@v8
if: ${{ github.event_name == 'pull_request' }}
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
- uses: ansys/actions/doc-changelog@v8
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
use-conventional-commits: true
use-default-towncrier-config: true
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}

code-style:
name: Code style
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/644.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
migrate css to scss
19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
{
"name": "ansys_sphinx_theme",
"repository": "https://github.com/ansys/ansys-sphinx-theme",
"description": "",
"main": "",
"scripts": {
"build": "echo 'No build step needed' "
"build:scss": "sass src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme.scss src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/styles/ansys-sphinx-theme.css",
"build:postcss": "postcss src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/styles/ansys-sphinx-theme.css -o src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/styles/ansys-sphinx-theme.css",
"build": "npm run build:scss && npm run build:postcss"
},
"dependencies": {},
"devDependencies": {}
"devDependencies": {
"autoprefixer": "^10.4.21",
"postcss": "^8.5.3",
"postcss-cli": "^11.0.0",
"postcss-import": "^16.1.0",
"postcss-nested": "^7.0.2",
"sass": "^1.85.1"
},
"dependencies": {
"postcss-scss": "^4.0.9"
}
}
5 changes: 5 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const config = {
plugins: [require("autoprefixer"), require("postcss-nested")],
};

module.exports = config;
7 changes: 0 additions & 7 deletions src/ansys_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@
THIS_PATH = pathlib.Path(__file__).parent.resolve()
THEME_PATH = THIS_PATH / "theme" / "ansys_sphinx_theme"
STATIC_PATH = THEME_PATH / "static"
STYLE_PATH = STATIC_PATH / "css"
JS_PATH = STATIC_PATH / "js"
CSS_PATH = STYLE_PATH / "ansys_sphinx_theme.css"
TEMPLATES_PATH = THEME_PATH / "_templates"
AUTOAPI_TEMPLATES_PATH = TEMPLATES_PATH / "autoapi"
LOGOS_PATH = STATIC_PATH / "logos"
Expand Down Expand Up @@ -1134,11 +1132,6 @@ def setup(app: Sphinx) -> Dict:
use_ansys_search = app.config.html_theme_options.get("use_ansys_search", True)
if use_ansys_search:
update_search_config(app)

# Verify that the main CSS file exists
if not CSS_PATH.exists():
raise FileNotFoundError(f"Unable to locate ansys-sphinx theme at {CSS_PATH.absolute()}")
app.add_css_file(str(CSS_PATH.relative_to(STATIC_PATH)))
app.config.templates_path.append(str(TEMPLATES_PATH))
app.add_js_file("https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js")
app.add_css_file("https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* Provided by the Sphinx base theme template at build time */

@import "pydata-sphinx-theme-custom.css";
@import "breadcrumbs.css";
@import "ast-search.css";
@import "sphinx-design.css";
@import "table-custom.css";
@import "sphinx-gallery.css";
@import "whatsnew.css";
@import "nbsphinx.css";
@import "ansys-sphinx-theme-variable.css";
@import "pydata-sphinx-theme-custom";
@import "breadcrumbs";
@import "ast-search";
@import "sphinx-design";
@import "table-custom";
@import "sphinx-gallery";
@import "whatsnew";
@import "nbsphinx";
@import "ansys-sphinx-theme-variable";

/*
* Code cell
Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,58 @@
/* Static Search Results Container */
.static-search-results {
display: flex;
flex-direction: column;
align-content: stretch;
justify-content: flex-start;
position: absolute;
background-color: var(--ast-search-bar-enable-background);
width: 630px;
width: 39.375rem; /* 630px */
padding: 1em;
border: 1px solid var(--ast-search-bar-enable-border);
box-shadow: var(--ast-box-shadow-active);
overflow: auto;
max-height: 500px;
max-height: 31.25rem; /* 500px */
}

/* Individual Result Item */
.result-item {
cursor: pointer;
transition: box-shadow 0.3s ease;
border-bottom: thin solid var(--ast-search-bar-enable-border);
padding-bottom: 0.5em;
margin-bottom: 0.5em;
}

.result-item:last-child {
border-bottom: 0;
margin-bottom: 0;
&:last-child {
border-bottom: 0;
margin-bottom: 0;
}

&.selected {
box-shadow: var(--ast-ring-shadow-focused);
}
}

/* Result Title */
.result-title {
font-size: 1em;
font-weight: var(--ast-font-weight-bold);
font-family: "Open Sans", sans-serif;
color: var(--ast-catagory-header-text);
}

/* Result Text */
.result-text {
font-size: 12px;
font-size: 0.75rem; /* 12px */
font-family: "Open Sans", sans-serif;
color: var(--ast-search-bar-enable-text);
}

.result-item.selected {
box-shadow: var(--ast-ring-shadow-focused);
}

/* Highlighted Text */
html[data-theme="light"] .highlight {
color: var(--ast-highlight-color);
}

/* Search Input Styles */
.bd-search input.form-control,
.bd-search input.form-control:focus,
.bd-search input.form-control:focus-visible,
Expand All @@ -55,98 +61,108 @@ html[data-theme="light"] .highlight {
.form-control {
background-color: var(--ast-search-bar-enable-background);
color: var(--ast-search-bar-enable-text);
font-size: 14px;
font-size: 0.875rem; /* 14px */
outline-color: var(--ast-search-bar-enable-border);
border: 0px solid var(--ast-search-bar-enable-border);
width: 300px;
border: 0;
width: 18.75rem; /* 300px */
transition: max-width 0.3s ease;
max-width: 200%;
height: 40px;
height: 2.5rem; /* 40px */
}

/* Search Button Wrapper */
.search-button__wrapper.show input,
.search-button__wrapper.show svg {
font-size: 14px;
font-size: 0.875rem; /* 14px */
}

/* Search Button Keyboard Shortcut */
.bd-search .search-button__kbd-shortcut {
background-color: var(--ast-search-bar-enable-background) !important;
box-shadow: none !important;
height: 36px;
height: 2.25rem; /* 36px */
display: flex;
flex-wrap: wrap;
align-content: center;
}

/* Index Select Dropdown */
.index-select {
color: var(--ast-search-bar-enable-text);
background: var(--ast-search-bar-enable-background);
height: 40px;
font-size: 14px;
height: 2.5rem; /* 40px */
font-size: 0.875rem; /* 14px */
font-family: "Open Sans", sans-serif;
border: 0.5px solid var(--ast-search-bar-enable-border);
border-radius: 4px;
border: 0.03125rem solid var(--ast-search-bar-enable-border); /* 0.5px */
border-radius: 0.25rem; /* 4px */
box-shadow: none;
padding: 0px 8px;
margin-left: 2px;
padding: 0 0.5rem; /* 0 8px */
margin-left: 0.125rem; /* 2px */
}

/* Focus Visible Outline */
:focus-visible {
outline: none;
}

/* Search Icon */
#search-icon {
font-size: 24px;
width: 24px;
height: 24px;
font-size: 1.5rem; /* 24px */
width: 1.5rem; /* 24px */
height: 1.5rem; /* 24px */
color: var(--ast-search-bar-enable-text);
}

/* Form Control Focus Styles */
.form-control:focus,
.bd-search:focus-within {
box-shadow: none;
}

/* Button Styling */
/* Search Button Styling */
.search-button__button {
transition: width 0.3s ease;
width: 50px; /* Initial width */
width: 3.125rem; /* 50px */
}

/* Result Container Styling */
.bd-search {
gap: 8px;
gap: 0.5rem; /* 8px */
background-color: var(--ast-search-bar-enable-background);
border: 0px solid var(--ast-search-bar-enable-border);
margin-bottom: 0px;
}
border: 0 solid var(--ast-search-bar-enable-border);
margin-bottom: 0;

.bd-search input.form-control.expanded {
width: 600px;
input.form-control.expanded {
width: 37.5rem; /* 600px */
}
}

/* Search Icon Styling */
.search-icon {
cursor: pointer;
}

/* Blurred Main Content */
.bd-main.blurred {
opacity: 0.5;
transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
/* Responsive Styles */
@media (max-width: 48rem) { /* 768px */
.bd-search input.expanded {
width: 100px;
width: 6.25rem; /* 100px */
}

.form-control {
width: 50px;
width: 3.125rem; /* 50px */
}

.result {
width: 100px;
width: 6.25rem; /* 100px */
}

.bd-search .search-button__kbd-shortcut {
display: none;
}
}
}
Loading
Loading